Thank you, but my data sample was too simplistic. Please consider this
scenario:
I want to change only the two last date fields formatted as yyyymmddhhmm
to
mmddyyyy in a text file such as:
2133 AB 200705240233 200705240929
0119 RG 200610011921 200711122300
to:
2133 AB 05242007 05242007
0119 RG 10012006 11122007
where all fields are fixed length, and all field positions are known. Is
it
possible to get this macro to run automatically from a command line call?
Thank you for any hints.
Graham Mayor said:
The macro is largely superfluous here
With the patterns shown a simple wildcard search for
(2007)(0523)([0-9]{4})
replace with
\2\1\3
will do the job
If the first part are changeable dates you could use a search string of
([0-9]{4})([0-9]{4})([0-9]{4}) instead (replace string is the same) but I
would prefer to tie the year down more tightly - see
http://www.gmayor.com/replace_using_wildcards.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
How can I build a macro to run on the command-line to do a simple
editing of a text file with a regular pattern to it?
I want to change the text file contents of:
200705230822
200705231341
200705230904
to end up as:
052320070822
052320071341
052320070904