I used your sed command and it works very well except i still have one problem. The three lines of code
Fri Nov 5 15:31:33 2010 00:28:17 R7_BCGNOFJ_70.68
Fri Nov 5 20:57:41 2010 00:07:21 R7_ADJCEL_80.6
Wed Nov 10 17:33:21 2010 00:01:13 R7_BCTTEST3_80.1X
i showed earlier are part of a 1001 line file. The format of each line is exactly the same. However, when i run the sed command the first 180 or so lines come out like the following;
Sat Oct 06:37:31 2010 00:30:21 CMS
Sat Oct 06:38:48 2010 00:30:24 WRANMOMFJ
Sat Oct 06:40:30 2010 00:33:14 WRANMOMFJ
...
i.e. the time of day and not the date is being printed. The rest of the lines come out perfectly. Any suggestions on how to fix this? Could i use a "for" loop or a "do" loop to go through each individual line?
Though I did not try your command, I know there are some issues with
calling awk on some platforms. Therefore, if you are porting your code
to different platforms you may want to call this function than replace awk with $AWK
which_awk()
{
if [ -n "$SCRIPT_PATH" ]
then
eval $SCRIPT_PATH
fi
whence nawk > /dev/null
if [ $? -eq 0 ]
then
AWK=nawk
else
whence awk > /dev/null
if [ $? -eq 0 ]
then
AWK=awk
else
AWK=gawk
fi
fi
}