I am trying to convert some date seperators in a large newline delimited file. each line i am interested in has a date in the format 27/05/2009 all I want is to convert the slashes to tildes(~) I have come up with the following code but it does nothing.
sed 's/\([0-9]\{2\}\)\/\([0-9]\{2\}\)\/\([0-9]\{4\}\) / \1~\2~\3 /' alltrans.test > at3.txt
or
sed 's_%([0-9]%{2%}%)%/%([0-9]%{2%}%)%/%([0-9]%{4%}%) _%1~%2~%3_' alltrans.test > at3.txt
Hey Locks, that will change all occurences of / and unfortunately I need to only change them in the lines that have a date as the complete record. If it might make it any easier the date line is consitently every 19th line