Here is a slightly different approach that seems to work:
If you want to try this on a Solaris/SunOS system, change awk to /usr/xpg4/bin/awk or nawk.
In addition to the output you said should be produced from your sample log.txt file, it also prints the output:
Is there some reason why these lines should have been deleted from the output?
This User Gave Thanks to Don Cragun For This Post:
how to use "tr" command to display horizontal line to vertical line
for vertical to horizontal, the command is tr '\n' '\t' <inputfile
but what is the command for horizontal to vertical
Thanks
Vasikaran (3 Replies)
Hi,
I have a file like below
robert
PREF: 3
AVAIL:
henry
PREF: 234
AVAIL:
john
PREF: 145,178
AVAIL: 123
matt
PREF: 564,932
AVAIL:
ten
PREF: 389
AVAIL: kill (2 Replies)
Hi,
Silly question, if I have an excel file that looks something like this:
................. Subject 1 Subject 2 Subject 3 Subject 4
Fever..............13...........9.............23..........14
Headache.........2............12...........18..........23... (3 Replies)
How to move a vertical line to Horizontal line.....Can i use a tr command?
code is:
StudentID
Java
.Net
C#
I want to move this line like this:
StudentID Java .Net C#
Please use
code tags! (3 Replies)
Need perl or shell script to sort vertical lines to horizontal line in csv format
My file like below
-------------------------
================================================================================
PATH PINKY1000#I1-1-ZENTA1000-2#I7-1-ASON-SBR-UP-943113845 ... (4 Replies)
Hi,
I have log like this :
And i want the output like below :
I have try using awk but doesn't work
awk '
/ffff /{ts=$1}
f && /SectorAntenna\=1/{sa1=$3}
f && /SectorAntenna\=2/{sa2=$3}
f && /SectorAntenna\=3/{sa3=$3}
{
s= ts "|" sa1 "|" sa2 "|" sa3
print s
f=0
}' (7 Replies)