Removing with wildcard

  • Thread starter Thread starter dk
  • Start date Start date
D

dk

How can we remove numbers in begining of line all numbers with also date
format removed ?
ex:12/24/2002 10:34 AM 35,607 57084Eudora.zip
we want only strating from Eudora kept
 
dk said:
How can we remove numbers in begining of line all numbers with also date
format removed ?
ex:12/24/2002 10:34 AM 35,607 57084Eudora.zip
we want only strating from Eudora kept

If your sample text is truely representative of the text you have in your
document, use the following in the "Find what" box of the Replace dialog:

*M([0-9, ,\,]@)([!0-9]@^13)

Then use this in the "Replace with" box:

\2

Click on "More" and check the "Use wildcards" checkbox.
Then try "Replace All".

If it does not do what you want, undo rigth away. You may need to tinker
with the "Find what" expression.
 
One problem might be that file names can start with numbers, too.

If the text file uses tabs, it might be best to delete everything up to the
4th (or whatever) tab.
Or if the text file uses blanks, delete the appropriate number of characters
from the start.

Regards,
Klaus


Jean-Guy Marcil said:
dk said:
How can we remove numbers in begining of line all numbers with also date
format removed ?
ex:12/24/2002 10:34 AM 35,607 57084Eudora.zip
we want only strating from Eudora kept

If your sample text is truely representative of the text you have in your
document, use the following in the "Find what" box of the Replace dialog:

*M([0-9, ,\,]@)([!0-9]@^13)

Then use this in the "Replace with" box:

\2

Click on "More" and check the "Use wildcards" checkbox.
Then try "Replace All".

If it does not do what you want, undo rigth away. You may need to tinker
with the "Find what" expression.
 
doesn't seem to work we are sending again example
05/14/2002 02:55 , 3,159,017 1.2.0.1620_enu_tr.zip
07/05/2001 08:07 , 2,403,276 1240WC.EXE
07/04/2001 12:03 AM 4,416,001 34CN115.EXE
03/22/2001 03:18 , 1,506,387 4130xdat.exe
12/24/2002 10:34 AM 35,607 57084Eudora.zip
07/05/2001 03:00 , 1,159,429 730WWDME.EXE
01/07/2003 12:15 AM 14,710,662 A5V451.exe
01/07/2003 12:56 AM 15,498,203 A5V5.exe
10/01/2002 10:20 AM 205,548 AAD414.48(alpha5).zip
06/06/2002 10:30 , 84,978 AddUtil.zip
04/22/2001 02:30 , 8,820,072 ar500enu.exe
02/09/2003 12:05 , 366 aspi32.exe.lnk

we want to remove up to last word on each line

Jean-Guy Marcil said:
dk said:
How can we remove numbers in begining of line all numbers with also date
format removed ?
ex:12/24/2002 10:34 AM 35,607 57084Eudora.zip
we want only strating from Eudora kept

If your sample text is truely representative of the text you have in your
document, use the following in the "Find what" box of the Replace dialog:

*M([0-9, ,\,]@)([!0-9]@^13)

Then use this in the "Replace with" box:

\2

Click on "More" and check the "Use wildcards" checkbox.
Then try "Replace All".

If it does not do what you want, undo rigth away. You may need to tinker
with the "Find what" expression.
 
Assuming each line ends with a paragraph mark
Replace
[0-9]{2}/[0-9]{2}/[0-9]{4}*[0-9,]{4,}[ ](*)^13
with
\1^p
with the wildcard option set

http://www.gmayor.com/replace_using_wildcards.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

doesn't seem to work we are sending again example
05/14/2002 02:55 , 3,159,017 1.2.0.1620_enu_tr.zip
07/05/2001 08:07 , 2,403,276 1240WC.EXE
07/04/2001 12:03 AM 4,416,001 34CN115.EXE
03/22/2001 03:18 , 1,506,387 4130xdat.exe
12/24/2002 10:34 AM 35,607 57084Eudora.zip
07/05/2001 03:00 , 1,159,429 730WWDME.EXE
01/07/2003 12:15 AM 14,710,662 A5V451.exe
01/07/2003 12:56 AM 15,498,203 A5V5.exe
10/01/2002 10:20 AM 205,548 AAD414.48(alpha5).zip
06/06/2002 10:30 , 84,978 AddUtil.zip
04/22/2001 02:30 , 8,820,072 ar500enu.exe
02/09/2003 12:05 , 366 aspi32.exe.lnk

we want to remove up to last word on each line

Jean-Guy Marcil said:
dk said:
How can we remove numbers in begining of line all numbers with
also date format removed ?
ex:12/24/2002 10:34 AM 35,607 57084Eudora.zip
we want only strating from Eudora kept

If your sample text is truely representative of the text you have in
your document, use the following in the "Find what" box of the
Replace dialog:

*M([0-9, ,\,]@)([!0-9]@^13)

Then use this in the "Replace with" box:

\2

Click on "More" and check the "Use wildcards" checkbox.
Then try "Replace All".

If it does not do what you want, undo rigth away. You may need to
tinker with the "Find what" expression.
 
Or, taking it from the other end,

Find what: *[^32^9]([!^32^9]@^13)
Replace with: \1

I wouldn't count on the filename being a single word (that is, contains no
spaces) in a serious application though.

If the text export came from a DIR output and the columns were originally
aligned, the method I suggested earlier should be safer.

Regards,
Klaus
 
Back
Top