Hi All,
I have a data in flat file like below. Some of the information are in second row.
111_ABCProcess ----- ----- IN 0/0
111_PQRTrimPRocess
----- ----- OI 0/0
111_ZigZagTrimProcess ----- ----- IN 0/0
111_CommandLoadProcess
09/22/2009 07:23 09/22/2009 07:23 FA 21960994/13 255
111_MurtyDumpProcess 01/30/2008 13:04 01/30/2008 13:07 SU 21960994/11
I am using following code to merge 2 lines, if data are in 2 lines.
aa=" "
cat rawdata.txt | while read abc
do
if [[ `echo $abc | cut -c1-1` = "-" ]] || [[ `echo $abc | cut -c3` = "/" ]]
then
prevline="$prevline$aa$abc"
else
prevline=$abc
fi
echo $prevline >> rawdata_1.txt
done
But, it is taking too much time. I have arounf 3000 records in the file. Is there any other fast possible ways to do so... ie awk, nawk...?