Hi again:
I have a log file wihch has always this format:
DATA line 1
DATA line 2
^^^^^
| Spaces or TABs
The first line always begins from the start, but the second begins with spaces or TABs,
Question:
How can I add the second line to the first one?
I mean this:
DATA line 1 DATA line 2
Thanks
Israel.
can you give more sample, such as how about line 3, 4, 5.....
Hi rdcwayx
USER_Remove user user Thu Nov 04 10:37:47 2010 OK rmuser
israel
Group_Create user user Thu Nov 04 10:37:48 2010 OK mkuser
israel
Group_Remove user user Thu Nov 04 10:37:50 2010 OK rmuser
israel
USER_Create user user Thu Nov 04 10:37:51 2010 OK mkuser
israel
PASSWD_Change user user Thu Nov 04 10:37:51 2010 OK passwd
user2
Thanks
awk '{printf (NR%2)?$0 FS:$0 RS}' infile
awk 'ORS=(NR%2)?FS:RS' file
or
awk 'ORS=(/^ /)?RS:FS' file
1 Like