User: Aaron -- 2013-12-02 << 1149 1151 >> |
Hits: 4124 |
Type: Text file splitter |
Search all Text file splitter examples |
Description: |
I would like to extract and save text that follows the second comma in a line to one file and save the word or phrase before the comma to another file. Please note that there may be other comma after the second but I would like to save all the text following the second comma only. Each line may or may not end with punctuation. |
Input Sample: |
file.txt: 1111,22222,33333,44444 aaaa,bbbbbbb,ccccc,ddddd |
Output Sample: |
file.1.txt 1111,22222 aaaa,bbbbbbb file.2.txt 33333,44444 ccccc,ddddd |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
Assume you want to extract 1st part to file.1.txt, 2nd part to file.2.txt 1. open "Tools->Batch Runner" window 2. drag all text files to "Batch Runner" window 3. change the "set filename" entry to: 4. click "Fast Replace" button to open "Fast replace" dialogue 5. click "add" to add replace rule * leave "search" to be * set "replace" to be * click "ok" 6. make sure "regular expression" option is checked, and UNcheck "cross line" option 7. click "start", all text before "," will be write to file.1.txt To write the content after "," to new files, you just need: * change step 3 to: * change step 5 "search" to: set "replace" to: |
Screenshot 1: Batch_Runner_Window |