specific column position?
I want to insert 28 spaces before the newline character when the newline character appears in column 171 in order to make the record length equal 200:
2004011220040112 00000133.96 0000001.000 00000000.00 00000133.96078244\n
OR, is there a way to make all records the same length?
TIA...webbhe
How do I find and replace a newline character (\n) in a...
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
Here's one way:
(If the newline character is in column 171, the record length is 170. So adding 28 spaces makes the record length 198, not 200.)
This assumes you are using POSIX regular expression syntax:
where _ represents a space (there are 28 of them).Find what: ^.{170}$
Replace with: \0____________________________
[X] Regular expression
(If the newline character is in column 171, the record length is 170. So adding 28 spaces makes the record length 198, not 200.)
This assumes you are using POSIX regular expression syntax:
Configuration | Preferences | Editor
[X] Use POSIX regular expression syntax