3

Split a file into multiple files based on field value

view full story
linux-howto

http://www.unix.com – Hi, I've one requirement. I have to split one comma delimited file into multiple files based on one of the column values. How can I achieve this Unix Here is the sample data. In this case I have split the files based on date column(c4) Input file c1,c2,c3,c4,c5 123,GL,JE,06-02-2012,500 132,GL,JE,06-02-2012,600 123,GL,JE,06-01-2012,500 153,GL,JE,06-01-2012,600 Desired out put File 1 c1,c2,c3,c4,c5 123,GL,JE,06-02-2012,500 132,GL,JE,06-02-2012,600 File2 c1,c2,c3,c4,c5 123,GL,JE,06-01-2012,500 153,GL,JE,06-01-2012,600 Thanks (HowTos)