Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

904.Text file splitter -- How to split a CSV file with Header according to value of a column?

User: Domenico -- 2012-01-18          << 903  905 >>
Hits: 91
Type: Text file splitter   
Search all Text file splitter examples
Description:
I need to split a CSV file with Header according to value of a column
Input Sample:
File=All.csv
Channel;Customer;Turnover
Discount;AAAAAA;1000
Discount;BBBBB;300
Hiper;CCCCC;1500
Hiper;AAAAAA;2500
Output Sample:
File=Discount.csv
Channel;Customer;Turnover
Discount;AAAAAA;1000
Discount;BBBBB;300
File=Hiper.csv
Channel;Customer;Turnover
Hiper;CCCCC;1500
Hiper;AAAAAA;2500
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Assume your csv file are seperated by ";".

1. ctrl-o open the csv file
2. ctrl-h open 'replace' dialog
* set 'replace unit' to 'Line'
* set 'search for pattern' to:

click 'advanced' tab
* set 'run following for each matched unit' to:

3. click "replace", done, all file will be generated under d:\.

Note: if you want to create file under d:\test, you need create this folder first, and change all  to  in step 2.

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to split a csv file according to the value of column A? (82%)
How to split a csv file into multiple files according to value of column B? (75%)
How to split a file into two parts according to the content of line? (65%)
How to split a text file according to first word in each line? (62%)
How to split a text file to different files according to first word in each line? (61%)
How to sort lines of text file by comparing the sum of column1, 2 and 3? (60%)
How to batch sort csv files by the order of value in the specified column? (59%)
How to batch rename text files by adding the value of file content to filename? (56%)

Check Demo of Text file splitter
Keywords:
header  seperate  split a csv file  var  toc  create  text file splitter  splitter  test  acc  split csv file by value in column  split csv file by value  split csv file according to a column  csv first column  split csv according to column  csv file splitter by column  split file by column value  csv splitter by column