Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Find Replace dates dd/mm/yy from d/m/yy
Date in the dd/mm/yy format. Table contains 6/3/02 instead of 06/03/02 or 6/3/05 instead of 06/03/05.
I tried: Find what: ([!0])([1-9]/[0-9][0-9]/0[0-9]) Replace with: \10\2 Use Wildcards But it does not put the 0 in everywhere. Any ideas please? |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Find Replace dates dd/mm/yy from d/m/yy
If the dates are each alone in the cell of a table and the 0 is missing from
day and month then replace ([1-9]/)([1-9]/[0-9]) with 0\10\2 -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "JohnJ" wrote in message ... Date in the dd/mm/yy format. Table contains 6/3/02 instead of 06/03/02 or 6/3/05 instead of 06/03/05. I tried: Find what: ([!0])([1-9]/[0-9][0-9]/0[0-9]) Replace with: \10\2 Use Wildcards But it does not put the 0 in everywhere. Any ideas please? |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Find Replace dates dd/mm/yy from d/m/yy
Just to clarify what's happening, if a date with a single-digit day is the
first text in a cell, then the sub-expression [!0] in the expression ([!0])([1-9]/[0-9]/0[0-9]) won't match anything. The Find engine won't consider anything in the preceding cell (if any) to be a candidate for a match. Graham, the problem with the expression you suggest is that ([1-9]/) _will_ match the second digit of a two-digit day and it'll insert a zero in the middle; e.g., the date 11/2/05 will be changed to 101/02/05. I think this may be a case where a macro is necessary, to do a wildcard search for the expression [1-9]/[0-9]/0[0-9] and then examine the character (if any) that precedes the found range to decide whether to insert a zero. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. Graham Mayor wrote: If the dates are each alone in the cell of a table and the 0 is missing from day and month then replace ([1-9]/)([1-9]/[0-9]) with 0\10\2 Date in the dd/mm/yy format. Table contains 6/3/02 instead of 06/03/02 or 6/3/05 instead of 06/03/05. I tried: Find what: ([!0])([1-9]/[0-9][0-9]/0[0-9]) Replace with: \10\2 Use Wildcards But it does not put the 0 in everywhere. Any ideas please? |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Find Replace dates dd/mm/yy from d/m/yy
That's what comes with testing on too few date samples
-- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jay Freedman wrote: Just to clarify what's happening, if a date with a single-digit day is the first text in a cell, then the sub-expression [!0] in the expression ([!0])([1-9]/[0-9]/0[0-9]) won't match anything. The Find engine won't consider anything in the preceding cell (if any) to be a candidate for a match. Graham, the problem with the expression you suggest is that ([1-9]/) _will_ match the second digit of a two-digit day and it'll insert a zero in the middle; e.g., the date 11/2/05 will be changed to 101/02/05. I think this may be a case where a macro is necessary, to do a wildcard search for the expression [1-9]/[0-9]/0[0-9] and then examine the character (if any) that precedes the found range to decide whether to insert a zero. Graham Mayor wrote: If the dates are each alone in the cell of a table and the 0 is missing from day and month then replace ([1-9]/)([1-9]/[0-9]) with 0\10\2 Date in the dd/mm/yy format. Table contains 6/3/02 instead of 06/03/02 or 6/3/05 instead of 06/03/05. I tried: Find what: ([!0])([1-9]/[0-9][0-9]/0[0-9]) Replace with: \10\2 Use Wildcards But it does not put the 0 in everywhere. Any ideas please? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find multiple characters in one find using MSword find/replace | Microsoft Word Help | |||
Trying to replace words with fields using Find/Replace | Microsoft Word Help | |||
Using find and replace or macros to replace page ranges | Microsoft Word Help | |||
Find/ Replace is auto-capping the words I want to replace with | Microsoft Word Help | |||
Find and Replace: delete a line & find a number 10 | Microsoft Word Help |