i have a file which looks like this:
1 19166100
2 19179581
3 FW127
i need to replace <character><space><space>
with <zero><zero><character> where the character can be any number
between one and 9. i know how to replace the blanks with zeros but i can't figure out how to keep the character without replacing each group
one at a time.
insert and replace test
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
Based on your description, this sounds doable. But, I am finding your explanation confusing.
Could you provide a better example of Before and After strings? Use real examples vs. <character> and <zero>. It would be useful to use another char to represent the <space> so the count of spaces can be seen.
Could you provide a better example of Before and After strings? Use real examples vs. <character> and <zero>. It would be useful to use another char to represent the <space> so the count of spaces can be seen.
Hope this was helpful.............good luck,
Bob
Bob
-
- Posts: 10
- Joined: Wed Mar 12, 2008 2:33 pm
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
This works for one or more leading digits:
Search for: ^([0-9]+),,
Replace with: 00\1
Per your example, using comma "," for spaces.
Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Search for: ^([0-9]+),,
Replace with: 00\1
Per your example, using comma "," for spaces.
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
-
- Posts: 10
- Joined: Wed Mar 12, 2008 2:33 pm
thanks for the solution
thanks very much.
works like a charm.
you guys are great!
works like a charm.
you guys are great!