User: Aaron -- 2013-10-28 << 1143 1145 >> |
Hits: 4157 |
Type: Text file splitter |
Search all Text file splitter examples |
Description: |
I would like to extract and save text that follows the first dash in a line to one file and save the word or phrase before the dash to another file. Please note that there may be other dashes after the first but I would like to save all the text following the first dash only. Each line may or may not end with punctuation. |
Input Sample: |
Input Example: Word1 - asdfadfasfa - jkh;h;jhljhlh Phrase 2 - oiuyiyoiuyoiuyouy Word3 - qwerqerqerqerq - uipipiupiupi? etc. |
Output Sample: |
Output File 1: Words or phrases before the first dash. Word1 Phrase 2 Word3 etc. Output File 2: Text that follows the first dash. asdfadfasfa - jkh;h;jhljhlh oiuyiyoiuyoiuyouy qwerqerqerqerq - uipipiupiupi? etc. |
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 blank * 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: |
Screenshot 1: Batch_Runner_Window |