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
Replace text in certain columns
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
Re: Replace text in certain columns
The following assumes you are using POSIX regular expression syntax:
Using Search | Replace:Configuration | Preferences | Editor
[x] Use POSIX regular expression syntax
where **** is the replacement for the 4 characters.Find what: (^.{363}).{4}
Replace with: \1****
[x] Regular expression
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?
-
- Posts: 5
- Joined: Wed Apr 30, 2003 3:02 pm
- Location: Halifax, West Yorkshire, England
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.
(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.