Searching and Replacing strings using SED command
Posted on 2004-10-04
I am trying to rearrange this string: Pooh:bear:honey:5/14/1942 so that is outputed this way:
This is the command I am using:
sed "s/^\(.*\):\(.*\)$/\2:\1/" aamilne.org >> test1
where aamilne.org is the orginal file with the strings and I am redirecting the new output into a test file before amending it to the correct file.
Using this command my output is: 5/14/1942:Pooh:bear:honey
Can someone please help me. Also if anyone knows of a good website to help me with this matter as well. I am confused on using the regular expressions.
Thank you to all.