Hi,
I'm editing a text file and trying to make TextCrawler search a certain phrase or word, delete the entire line and be replaced by a different line.
Example,
The bus was carrying a lot of people.
The bus is stuck and cannot move forward.
The bus will be delayed.
TextCrawler would have to find only the word "bus" and replace all those lines with that word by "The car is parked" in each line, resulting in something like this:
The car is parked.
The car is parked.
The car is parked.
Can I do this with this program?
Search and Replace entire line
- DigitalVolcano
- Site Admin
- Posts: 1863
- Joined: Thu Jun 09, 2011 10:04 am
Re: Search and Replace entire line
It would be something like this
-Regular Expression mode
- Dot matches newline OFF
- Multiline Anchors ON
RegEx
Replace:
-Regular Expression mode
- Dot matches newline OFF
- Multiline Anchors ON
RegEx
Code: Select all
^.*bus.*$
Code: Select all
the car is parked
-
- Posts: 2
- Joined: Wed Sep 01, 2021 8:06 pm
Re: Search and Replace entire line
It does not work, it leaves residues of the previous text, have to clean the entire line before inserting the new text.DigitalVolcano wrote: Thu Sep 02, 2021 10:20 am It would be something like this
-Regular Expression mode
- Dot matches newline OFF
- Multiline Anchors ON
RegExReplace:Code: Select all
^.*bus.*$
Code: Select all
the car is parked