Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1367.Text file parser -- How to extract different part from adjacent lines?

User: user -- 2016-05-23          << 1366  1368 >>
Hits: 1180
Type: Text file parser   
Search all Text file parser examples
Description:
There are many lines in a text file, in which each word is separated by #### in the
line. How to extract the first word and the second word of the following line.
Input Sample:
a111####b111####c111
a222####b222####c222
a333####b333####c333
a444####b444####c444
Output Sample:
a111####b222
a222####b333
a333####b444
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 'replace unit' to 'Line'
* set 'unit number filter' to: 
* uncheck 'print unmatched units' option
* set 'replace with pattern' to:

3. click 'replace', done

Screenshot 1:  Replace_Window


Similar Examples:
How to extract and join first words from adjacent lines? (78%)
How to extract text from 'start' to 'end' in each line? (65%)
How to add in different sentences after the different lines? (64%)
How to calculate time difference of two adjacent and matched lines? (61%)
How to merge different CSV with partially different columns into one? (59%)
How to extract distinct webpages from weblog file? (59%)
How to add different words at the beginning of each line? (58%)
How to exract specified strings started with www from text file? (57%)

Check Demo of Text file parser
Keywords:
adjacent lines  adjacent line  adjacent  previous  separate  first word  unit number filter  number filter  second  unmatched  extract lines from text file by filter  extract first number in the line  extract first number from a line  extract line by number  extract lines text file line number  extract lines from word  first and second words  replace with previous line