| User: Andy -- 2013-12-14 << 1157 1159 >> |
| Hits: 3678 |
| Type: Text file parser |
| Search all Text file parser examples |
| Description: |
| How to extract all data with format of ##.##-##.## from many text file, and write output to a new text file with specified format? |
| Input Sample: |
| File1:MS_GR11720131212.txt ... Crude Soybean Oil 37.74- 38.49 dn 0.41 -225F to-150 F unch 46.5% Soybean Meal R 445.10- 455.10 dn 8.8 +15 F to +25 F unch 46.5% Soybean Meal T 445.10- 460.10 dn 8.8 +15 F to +30 F unch Soybean Hulls-bulk 170.00- 190.00 unch Soybean Hulls-pellets 170.00- 195.00 dn 1000-unch File2:... File3:... |
| Output Sample: |
| 20131212 37.74 38.49 445.10 455.10 445.10 460.10 170.00 190.00 170.00 195.00 12.6975 13.0175 20.25 18.25 lines for file2... lines for file3... |
| Answer: |
| Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
| 1. open "Tools->Batch Runner" menu 2. drag multiple files from "Windows File Browser" to "Batch Runner" window 3. click "Fast Replace" button click "add" to add 1st rule: * set "search" to: * set "replace" to: * click ok click "add" again to add 2nd rule: * set "search" to: * set "replace" to: * click ok click "add" again to add 3rd rule: * set "search" to: * set "replace" to: * click ok 4. check option of "Reg exp", "Cross Line", and "Extract" 5. click "start", and select "output to single file", done. Note: don't forget to check "Extract". |
Screenshot 1: Fast_Replace_Window |