Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1067.Text file parser -- How to search specific strings and save each instance into a text file?

User: editor -- 2013-03-25          << 1066  1068 >>
Hits: 1483
Type: Text file parser   
Search all Text file parser examples
Description:
How to search specific strings and save each instance into a text file? For example, search everything between <b> and </b>, and save to 1.txt, 2.txt, 3.txt, etc.
Input Sample:
<html>
<b>text1</b>
...
<b>text2</b>
...
<b>text3</b>
...
<b>text4</b>
...
</html>
Output Sample:
1.txt:
text1

2.txt:
text2

3.txt:
text3

4.txt:
text4
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open 'text' file
2. ctrl-h open 'replace' dialogue
* set 'search for pattern' to:

* set 'replace with pattern' to:

* click 'advanced' tab, set 'run following for each matched unit' to:

3. click 'Replace', all file 1.txt, 2.txt ... will be saved in d:\test\ folder.

Note: folder delimiter should be double backslash, such as:
d:\\test\\$word_no.txt

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to exract specified strings started with www from text file? (69%)
How to replace specific spaces into comma in each line of text file? (68%)
How to search and replace strings in multiple utf-8 encoded text files? (62%)
How to count the occurrance of specific pattern in each line of text file? (62%)
How to delete the first word in each line in a text file? (60%)
How to search and sum the numbers at specified position in a text file? (58%)
How to duplicate each line 5 times in a text file? (58%)
How to insert a line after specific lines in a text file? (58%)

Check Demo of Text file parser
Keywords:
specific  backslash  double  slash  var  led  strings  two  delimiter  test  set replace everything between  tab delimiter  advanced text file parser  replace with specific  open printf file  replace strings  text between pattern  search and replace between