Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

115.Advanced search and replace -- How to join every n lines into 1 line in a text file?

User: editor -- 2008-05-16          << 114  116 >>
Hits: 4128
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to join every n lines into 1 line in a text file? 
Input Sample:
1111111 
2222222 
3333333 
4444444 
5555555 
6666666 
7777777 
8888888 
...
Output Sample:
1111111 2222222 3333333 
4444444 5555555 6666666 
7777777 8888888 9999999 
... 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source file 
2. ctrl-h open 'Replace' dialog: 
in 'Replace' page: 
* set 'Unit number filter': 
 
* set 'Search for pattern': 
 
* set 'Replace with Pattern': 
 -- one space 
3. click 'Replace', ok! 
Note: the operation means replace <return> with <space> except line 3,6,9,... 
!3<3> mean lines except 3,6,9,... 
You can also use following shotcut, Menu: Replace->Replace by Template->Line Replace->Join every 3 lines into 1 line. 
Download Script:  scripts/115.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to join same language lines into 1 line in a text file? (83%)
How to join every sequential line with a random line in a text file? (80%)
How to join every 3 lines into 3 columns of csv file? (79%)
How to join every 50 or 500 lines together in a text file? (76%)
How to random remove x lines from a line range in text file? (73%)
Join every 3 lines into one line (70%)
How to insert 100 different lines into the beginning of 100 text files? (68%)
How to join the specified 2 or 3 lines together alternatively in a text file? (67%)

Check Demo of Advanced search and replace
Keywords:
replace return with space  join every n lines  join every 3 lines  except  join every n line  tel  cut  replace return  return  template  join every lines into line  join every 3 lines into one line  join every 3 lines in a file  join every n lines to one  except search text  join lines into line  every 3 lines into a line  join 3 lines into one