User: park -- 2011-02-17 << 719 721 >> |
Hits: 5049 |
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 "first word" in each line, and write each "first word" into corresponding "filename". |
Input Sample: |
SH000001 2011-01-17 -1.192326 SH000001 2011-01-18 -0.363190 SH000001 2011-01-19 0.165015 SH000001 2011-01-20 -0.680117 SH000001 2011-01-21 0.165266 SH000001 2011-01-24 -0.291375 SH000001 2011-01-25 -0.444084 SH000001 2011-01-26 -0.024484 SH000001 2011-01-27 0.432198 SH000002 2011-02-15 -0.246460 SH000002 2011-02-16 0.083018 SH000002 2011-02-17 -0.280883 SH000003 2011-02-15 -0.132115 SH000003 2011-02-16 0.059704 SH000003 2011-02-17 0.087619 SH000004 2011-02-15 |
Output Sample: |
SH000001.txt SH000001 2011-01-17 -1.192326 SH000001 2011-01-18 -0.363190 SH000001 2011-01-19 0.165015 SH000001 2011-01-20 -0.680117 SH000001 2011-01-21 0.165266 SH000001 2011-01-24 -0.291375 SH000001 2011-01-25 -0.444084 SH000001 2011-01-26 -0.024484 SH000001 2011-01-27 0.432198 SH000002.txt SH000002 2011-02-15 -0.246460 SH000002 2011-02-16 0.083018 SH000002 2011-02-17 -0.280883 SH000003.txt SH000003 2011-02-15 -0.132115 SH000003 2011-02-16 0.059704 ... |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
1. ctrl-o open the text file 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, the files will be written to your "replace pioneer" installation path. Note: * if you need to create file under specified folder like d:\test, fill "run following foreach matched unit" like: * if your file or folder contains non-english characters, please download version 2.61 or newer, and use: * the folder like d:\\test should be created in advance. |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |