Hi all,
I get files that need to be converted from:
001 Company A
002 Company BBB
003 Brand 123
004 Brand WXYABC
005 Just any kind of text
to:
(001) Company A^
(002) Company BBB^
(003) Brand 123^
(004) Brand WXYABC^
(005) Just any kind of text^
There might be a few additional spaces at the end of some lines but I still need the "^" to be right after the last character on the line (not counting a space).
Thanks so much,
George
Substitution or Expression
Moderators: AmigoJack, bbadmin, helios, MudGuard
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
Search for: ^([0-9]{3})(.*)
Replace with: \(\1\)\2^
Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Replace with: \(\1\)\2^
Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Hope this was helpful.............good luck,
Bob
Bob
-
George Musick
- Posts: 5
- Joined: Sat Jun 21, 2008 2:19 pm
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
Make sure you are using Posix regular expression syntax, as Bob specified in his instructions:
If the length of the number might be different from 3, use
and remove the space that got added to the end of the regular expression when you copied it.Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
If the length of the number might be different from 3, use
(You don't need to quote parentheses with a backslash in the replacement expression.)Find what: ^([0-9]+)(.*)
Replace with: (\1)\2^
-
George Musick
- Posts: 5
- Joined: Sat Jun 21, 2008 2:19 pm