Bash or PHP: Split csv file based on field value?
Greetings all,
Is there a bash script out there that can split csv files based on a field in the csv file?
Here's a sample of my file:
master.csv
200,123,100.00
200,124,100.00
200,125,100.00
300,223,100.00
300,224,100.00
What I'd like to have is:
200.csv
200,123,100.00
200,124,100.00
200,125,100.00
300.csv
300,223,100.00
300,224,100.00
The record counts are different and there are a total of about 100 files I'd like master.csv split into.
If this can be done in Excel, that would be fine as well.
Thanks in advance!
|