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: 3445
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 with Header according to value of  column B? (98%)
How to split a csv file according to the value of column A? (82%)
How to substract one csv file from another according to value of column A? (75%)
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 split a text file to different files according to first word in each line? (61%)

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