User: editor -- 2010-09-07 << 605 607 >> |
Hits: 3720 |
Type: Text file splitter |
Search all Text file splitter examples |
Description: |
How to split a text file to different files according to first word in each line? Need to split a base file with format of "filename-linexxx" in each line, and write each "linexxx" into corresponding "filename". |
Input Sample: |
The source file list.txt contain following lines: d:\temp\a.txt-1111 d:\temp\b.txt-2222 d:\temp\a.txt-3333 d:\temp\a.txt-4444 d:\temp\b.txt-5555 |
Output Sample: |
The target files are: d:\temp\a.txt 1111 3333 4444 d:\temp\b.txt 2222 5555 |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
1. ctrl-o open list.txt 2. ctrl-h open replace window * set 'replace unit' to 'line' * in 'search for pattern', enter: * click "advanced" tab fill "run following for each matched unit" entry like: 3. click 'Replace' button, done. Note: for multiple files, you need to click "Batch..." button |
Download Script: scripts/606.rst.zip |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |