searching a date and replacing with another date

I have a text file that i want to search through and pick out any dates that are formatted like MM/DD/YYYY and replace them with a date i want like 10/29/2009. any idea show i would do this?:slight_smile:

Snapshot of my text file:

test4>s44syd5172>070>528>ENU>nongnuan>wanrawee>sr2330532>
THC>ms528enu>8>AB>>U11.0>10/26/2552>14:49:49>10/26/2552>16:01:53>
4317>0>871.00>36/6/0/p>8>1AB>4/1/0/p>80.00>>>>>>2AB>6/1/0/p>85.00>
>>>>>3AB>6/0/0/p>100.00>>>>>>4AB>6/1/0/p>85.00>>>>>>5AB>6/0/0/p>

Need to search and replace the highlighted text above with another date. Occurance will anywhere and many times in a text file .

Thanks
Please reply me ASAP:mad:

---------- Post updated at 04:31 AM ---------- Previous update was at 04:03 AM ----------

I dont want to update time. need only date

sed 's:[0-1][0-9]/[0-3][0-9]/[0-9][0-9][0-9][0-9]:10/18/2009' file_name

Try this...

thanks but it is not working
sed: fatal error: Unrecognized command: s:[0-1][0-9]/[0-3][0-9]/[0-9][0-9][0-9][0-9]:10/18/2009 :mad:

am sorry about the syntax i gav...

sed 's:[0-1][0-9]/[0-3][0-9]/[0-9][0-9][0-9][0-9]:10/18/2009:g' file_name

Thank u so much sir. this is working now.
:slight_smile:
Would really appreciate if you change this script for current date.
means instead of 10/18/2009 i want current date automatically. :slight_smile:

try this:

its giving error
date error: Syntax: date [ mm-dd-yy ] [ hh:mm:ss ]

can you please put in the command u used...
as i'm not getting any error wen i use it...