Page 1 of 1
Replace text in certain columns
Posted: Fri Apr 30, 2004 1:48 pm
by ps1290
I have a text file that is 750 characters long. I need to replace text
starting in column 364 for 4 characters. I have to do this on several
occurance of the data. How do I do this?
Thanks
Paul
Re: Replace text in certain columns
Posted: Fri Apr 30, 2004 2:15 pm
by ben_josephs
The following assumes you are using POSIX regular expression syntax:
Configuration | Preferences | Editor
[x] Use POSIX regular expression syntax
Using Search | Replace:
Find what: (^.{363}).{4}
Replace with: \1****
[x] Regular expression
where
**** is the replacement for the 4 characters.
ps1290 wrote:I have a text file that is 750 characters long. I need to replace text
starting in column 364 for 4 characters. I have to do this on several
occurance of the data. How do I do this?
Posted: Wed May 05, 2004 4:56 pm
by Jonathan_Taylor
Alternatively, block select the area of the file in question.
(This can be done using by selecting text while block select mode is on (Configure->Block Select mode) or pressing the Alt key when selecting).
If you want to change the four characters in EVERY line, then right-click->Fill Block will do the trick.....ensure "Fill Mode: replace" is selected.
Alternatively use Search->Replace, and ensure "Scope: selected text" is selected.