Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

76.Text file splitter -- How to split a single line into many lines, keep two words for each line?

User: editor -- 2008-05-11          << 75  77 >>
Hits: 4183
Type: Text file splitter   
Search all Text file splitter examples
How to split a single line into many lines, every line has two words?
Input Sample:
1 23456789_One 2 34567890_Two 3 23456789_Three 4 34567890_Four 5 23456789_Five 6 34567890_Six 7 23456789_Seven 8 34567890_Eight  
Output Sample:
1 23456789_One  
2 34567890_Two  
3 23456789_Three  
4 34567890_Four  
5 23456789_Five  
6 34567890_Six  
7 23456789_Seven  
8 34567890_Eight
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
The solution is to and a <Return> before words number 3,5,7,9,..., procedures: 
1. ctrl-o open source file 
2. ctrl-h open replace dialog, 
in 'Replace' page, 
1) set Replace Unit='word', Replace Scope='Line' 
2) Unit number filter: 
 means 3,5,7,9,... (start by 3, step is 2) 
3) Search for pattern: 
4) Replace with pattern: 
3. Click 'Replace', that's ok! 
Above operation means: replace the word with <return>+word in each line if the word number is 3,5,7,9,...
Download Script:  scripts/

Screenshot 1:  Replace_Window

Similar Examples:
How to split a single line into many lines according by Special symbols (72%)
How to split a file into many files according to first letter of each line? (67%)
How to split one line into two lines from middle? (62%)
How to split/parse lines into sentences outside two delimiters? (61%)
How to sort many lines by comparing the second word in each line? (60%)
How to split a file into two parts according to the content of line? (57%)
How to process text files, only keep the first word of each line? (57%)
How to batch split file delimitered by first dash in each line? (56%)

Check Demo of Text file splitter
split a single line  two words  before word  return  splitter  text file splitter  two  keep  unit number filter  number filter  every two words  split lines into words  split single line file into lines  word splitter open source  every two line  keep words  split line by words  split single line file