Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

789.Text file splitter -- How to split a csv file according to the value of column A?

User: editor -- 2011-05-27          << 788  790 >>
Hits: 3267
Type: Text file splitter   
Search all Text file splitter examples
Description:
How to split a csv file according to the value of column A? 
After splitting, need to use column A as filename. Note that the lines with same value in column A are adjacent.
Input Sample:
File: input.csv 
user1,aaa 
user1,bbb 
user1,ccc 
user2,ddd 
user2,eee 
user3,fff 
user3,ggg
Output Sample:
File: user1.csv 
user1,aaa 
user1,bbb 
user1,ccc 
 
File: user2.csv 
user2,ddd 
user2,eee 
 
File: user3.csv 
user3,fff 
user3,ggg
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source csv file 
2. ctrl-h open 'replace' dialog 
* set 'replace unit' to 'Line' 
* set 'replace with pattern' to: 
 
* set 'If' to: 
 
3. click 'Replace' 
4. click "File-> SaveAs->Split by Paragraph" menu 
* set "Para start" to "other", and set the following entry to: 
* set "Para end" to "None" 
5. click "Next", and input a filename in target folder, and click "Save", the csv file will be splitted to multiple csv files. 
 
(Note: if you have installed "Replace Pioneer 2.68" or newer version, following easier example and answer is recommended: 
target=_blank>http://www.mind-pioneer.com/services/879_Text_file_splitter.html) 

Screenshot 1:  Replace_Window


Similar Examples:
How to split a CSV file with Header according to value of  column B? (83%)
How to split a CSV file with Header according to value of a column? (82%)
How to split a csv file into multiple files according to value of column B? (80%)
How to substract one csv file from another according to value of column A? (78%)
How to split a text file according to first word in each line? (68%)
How to batch sort csv files by the order of value in the specified column? (65%)
How to split a text file according to specified tags? (64%)
How to split a file into many files according to first letter of each line? (64%)

Check Demo of Text file splitter
Keywords:
adjacent  same value  previous  split by paragraph  how to split a csv  split a csv file  how to split a csv file  led  csv files  non  splitting csv file according to column  csv file splitter open source  splitting file  split csv file by value in column  split csv file by value  csv splitter by value  csv splitter by column value  csv split by column value