I have an XML file and I am tring to extract some data form it, after lot of data cleaning process, I ended up with an issue, and need your urgent support.
Using words like "urgent" are prohibited to be used in normal forums. You could post your question in "emergency unix and linux support" forum(http://www.unix.com/emergency-unix-and-linux-support/\). Posting a new thread to this forum requires Bits. We monitor this forum to help people with emergencies, but we do not guarantee response time or answers. This forum is "best effort" only. Also it is a good practice to show us what have you tried with OS details etc.
I regret for the inappropriate words used in my post.
I am using CYGWIN to perform this task. I searched thru this forum to fix my issue, and found many useful codes, but all the outputs are placing current line appending with previous line.
however my requirement is to append the next line with current line.
---------- Post updated at 12:48 PM ---------- Previous update was at 12:38 PM ----------
I tried below code, but ending up with getting curent line appending to previous line.
If you are just trying to join pairs of lines keeping the initial spacing on odd numbered lines unmodified and removing leading spaces on even numbered lines, try:
awk '
NR % 2{ printf("%s", $0)
next
}
{ print $1
}' 2.txt > 3.txt
If you are trying this on a Solaris/SunOS system, change awk to /usr/xpg4/bin/awk or nawk .
Producing the same output with code closer to what you had, you could try:
I am not sure the output you have shown which shows us leading spaces are uneven, so if you need exact output as you have shown us then following may be helpful to you.