User: Seb Ip -- 2013-09-23 << 1134 1136 >> |
Hits: 4385 |
Type: Text file splitter |
Search all Text file splitter examples |
Description: |
need to split a CSV file with Header according to value of column B |
Input Sample: |
File=All.csv Channel;Customer;Turnover Discount;AAAAAA;1000 Discount;BBBBB;300 Hiper;CCCCC;1500 Hiper;AAAAAA;2500 |
Output Sample: |
File=AAAAAA.csv Channel;Customer;Turnover Discount;AAAAAA;1000 Hiper;AAAAAA;2500 File=BBBBB.csv Channel;Customer;Turnover Discount;BBBBB;300 etc |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
Assume you want to put result files to d:\test\ folder, first of all, you should make sure folder d:\test\ exist, then take following steps: 1. ctrl-o open CSV file 2. ctrl-h open 'replace' dialogue * set 'replace unit' to 'Line' * click 'advanced' tab, set 'run following for each matched unit' to: 3. click 'replace', the CSV file will be splitted into several csv files, according to the column B. Note: * If your csv delimiter is "," you should use: $M=words($match,2,2,','); * If your output folder is not d:\test, you should use: $F="d:\\Yourfolder...\\$M.csv"; You must use \\ as folder delimiter here. |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |