sh-2.05b$ echo "INFORM----Test.pc:168:10/11/05 12:34:26 > some text goes here.. " |
sed -e 's#\(.*\)[0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\(.*\)#\1<RUNDATE>\2#g'
INFORM----Test.pc:168:<RUNDATE> > some text goes here..
Overall it will be as
sed -e 's#\(.*\)[0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\(.*\)#\1<RUNDATE>\2#g' test.result > test.result.tmp
Hi Vino,
Once again thank you very much for your help. And as I am new to Sed, can you please explain the command that you have given to me or Also, can you please point me to some good sites where I can learn Sed?
It is working very well, but want to understand its working. I understood little only.
And here is one more problem I am facing, again I need your help:
Error: The directory /logDir/AR_archive/20051116135822 is not writeable
Error: The directory /test/logDir/AR_archive/20051116135822 is not writeable
I need to re-write as:
Error: The directory <AR_archive> is not writeable
I am trying the following:
sed -e 's#\(.*\)[AR_archive]/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\(.*\) #\1<AR_archive>\2#g'
But, it is giving:
Error: The directory /psg/gnanduri/Banksys/logDir/AR_archiv<AR_archive> is notwriteable.