Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

63.Advanced search and replace -- Can I find all lines containing word 'oil', and replace the whole line with text like '--This line is removed--'?

User: editor -- 2008-05-06          << 62  64 >>
Hits: 3277
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
Can I find all lines containing word 'oil', and replace the whole line with text like '--This line is removed--'? 
Input Sample:
 ?Housing picture worsens as Fannie sees price drop 
?Oil nears $123 on $200 oil prediction, supply... 
?Stocks lift even as oil prices soar near $123 a barrel 
?Cisco 3Q profit beats subdued expectations 
?Person close to talks: Sprint close to WiMax... 
Output Sample:
?Housing picture worsens as Fannie sees price drop 
--This line is removed-- 
--This line is removed-- 
?Cisco 3Q profit beats subdued expectations 
?Person close to talks: Sprint close to WiMax...
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Procedures:  
1.press ctrl-o to open source file  
2.press ctrl-h to open replace dialog, set as follows:  
In 'Replace' page:  
* Set 'Replace Unit' to be 'Line' 
* Fill 'Search for pattern' to be: 
 
* Fill 'Replace with pattern' to be: 
 
 
3. click 'Replace' Button, ok!  
Note: oil@ means 'oil' ignore case, in later version, you can check option of "ignore cases" instead of '@'. 
You can also fill oil@|food@ to match lines containing oil or food or OIL or Food, etc.
Download Script:  scripts/63.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to findout all lines that contain specified words in multiple files? (47%)
How to analyze a log file and find out how many lines contain 'Pass' and how many lines contain 'Fail'? (47%)
How to copy a line containing specified word and insert between line 1 and 2? (46%)
For each word in list, how to extract all lines contain the word and save to word.txt? (45%)
How to find all lines in file A that contain words in file B? (45%)
Can I change the word order of each line and add a comma as separator? (45%)
How to remove all letters before "=" in each line of text file? (44%)
How to convert each line of a text file to the new format? (44%)

Check Demo of Advanced search and replace
Keywords:
whole  tea  lines containing  ignore case  ignore  find  lines contain  containing  case  version  find lines containing in word  search replace whole line  match whole word  replace whole word  whole word  ignore lines  find word  ignore line