Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

554.Text file parser -- How to parse all text between two words and put "@" between results?

User: Jason -- 2010-07-04          << 553  555 >>
Hits: 414
Type: Text file parser   
Search all Text file parser examples
Description:
Parse all text between two words ( "SearchSM" and "Enter a Park") and put "@" between results
Input Sample:
SearchSM

Tombstone Territorial Park
==========================


Dawson, Yukon Canada




C/O Yukon Parks
P.O. Box 600
Dawson, Yukon Y0B 1G0
Canada

867-667-5648 Whitehorse Office
867-993-6850 Dawson Office

Tombstone Territorial Park Web Site

May-September.

No Entry Fee Charged

The Tombstone Mountain area, covering 1,558
square miles, is located in...

Enter a Park
Output Sample:
Tombstone Territorial Park
==========================


@Dawson, Yukon Canada




@C/O Yukon Parks
P.O. Box 600
Dawson, Yukon Y0B 1G0
Canada

@867-667-5648 Whitehorse Office
867-993-6850 Dawson Office

@Tombstone Territorial Park Web Site

@May-September.

@No Entry Fee Charged

@The Tombstone Mountain area, covering 1,558
square miles, is located in...
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source text file
2. ctrl-h open 'replace' dialog
* in 'Search for pattern', enter:

* in 'Replace with pattern', enter:

* uncheck option of "Print Unmatched Unit"
3. click "Replace", you will get the result.

How to run this on multiple files and put result together:
1. ctrl-h open 'Replace' dialog
* in 'Search for pattern', enter:

* in 'Replace with pattern', enter:

* uncheck option of "Print Unmatched Unit"
* change the ">" to ">> Append" at the left of "Output File" entry.
2. click 'Batch' button to open 'Batch Runner' window
* drag all files from "Windows file browser" to "Batch Runner" window
3. change the "Set output file name" entry from default "${FILENAME}" to the fixed value "result.txt"
4. click "Batch Replace" button, all result will be appended to "result.txt"
Download Script:  scripts/554.rst.zip

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Window


Similar Examples:
How to remove all text between 'start' and 'end' for multiple files? (58%)
How to keep all specified words in an article and remove rest words? (52%)
How to remove/delete all text between '1:' and 'user:'? (52%)
How to change all files that contains words "RRR" to read-only? (50%)
How to batch remove all the text that enclosed by a pair of parenthesis? (50%)
How to replace the contents between div tags with increasing number? (48%)
How to remove all lines that are not ended with word "ok" or "done"? (47%)
How to extract all lines that contain words A and B and C? (47%)

Check Demo of Text file parser
Keywords:
two words  together  fixed  append  ppen  between  unmatched  unmatch  result  print  get text between  replace between words  two files  text left  replace words multiple files  two text  text between pattern  multiple words