I have a CSV file which contains data like the following:-
1,275,,,275,17.3,0,"2011-05-09 20:21:45"
2,279,,,279,17.3,0,"2011-05-10 20:21:52"
3,276,,,276,17.3,0,"2011-05-11 20:21:58"
4,272,,,272,17.3,0,"2011-05-12 20:22:04"
5,272,,,272,17.3,0,"2011-05-13 20:22:10"
6,278,,,278,17.3,0,"2011-05-13 20:24:08"
7,270,,,270,17.3,0,"2011-05-13 20:24:14"
8,269,,,269,17.3,0,"2011-05-14 20:24:20"
9,278,,,278,17.3,0,"2011-05-14 20:24:26"
This file contains 4432986 rows of data.
I wish to split the file out basing the new file name on the date in the last column.
Therefore based on the data above i would want 6 new files with the rows for each day in each file.
I would like the files named in YYYY_MM_DD format.
I would also like to ignore the first column in the output data
So file 2011_05_13 would contain the following rows, with the first column excluded:-
272,,,272,17.3,0,"2011-05-13 20:22:10"
278,,,278,17.3,0,"2011-05-13 20:24:08"
270,,,270,17.3,0,"2011-05-13 20:24:14"
I am planning on doing this on a linux box, so anything using any linux utilities would be cool, sed awk etc ??