| User: editor -- 2008-05-16 << 114 116 >> |
| Hits: 617 |
| 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: |
| 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%) How to merge every 3 lines from file A and every 1 line from file B? (65%) How to replace every 3 instances found in a text file? (64%) How to add line_no before each line of a text file? (64%) How to remove around 1/2 lines randomly from a large text files? (63%) How to reverse all cases of letters in a text file? (63%) |
Check Demo of Advanced search and replace |
| Keywords: |
| join every n lines replace return with space except join every n line tel cut return unit number filter number filter template join every lines into line join every 3 lines in a file join every n lines to one join lines into line every 3 lines into a line except search text text file join every 3 line join lines |