Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1381.Text file parser -- How to re-group all lines in a file by a wordlist file?

User: Roger -- 2016-10-30          << 1380  1382 >>
Hits: 712
Type: Text file parser   
Search all Text file parser examples
Description:
How to re-group all lines in a file by a wordlist file?
Input Sample:
wordlist.txt:
abc
def

input.txt:
line contain abc1
line contain def
line contain abc2
line contain nothing
Output Sample:
output.txt:
abc
line contain abc1
line contain abc2

def
line contain def
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Assume all files are put under d:/test/ folder
1. ctrl-o open wordlist.txt
2. ctrl-h open 'replace' dialogue
* set 'replace unit' to 'Line'
* set 'replace with pattern' to:

if you need match word accurately, set 'replace with pattern' to:

* click 'advanced' tab, set 'run following at the beginning of replace' to:

3. click 'replace', done.

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to delete all lines appear in file B from file A? (66%)
How to remove all the lines appeared in file B,C,D from file A? (65%)
How to re-group all elements in specified range? (64%)
How to reverse the order of all the lines in a text file? (64%)
How to read each line of a file and insert into multiple files? (63%)
How to merge every 3 lines from file A and every 1 line from file B? (63%)
How to remove duplicate lines from a text file? (62%)
How to get the values from all lines of txt file and generate html files? (62%)

Check Demo of Text file parser
Keywords:
tel  grep  group  acc  test  input  beginning  at the beginning  content  ass  lines under  group lines  split word to txt files  join 2 lines if  join lines if  split by word  replace with a group  join all lines