I have a CSV file that contains the following data: -
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 data lines.
I want to split a file based on the new file name in the date of the last column.
Therefore, based on the above data, I would like to get 6 new files with lines for each day in each file.
I need files named in the format YYYY_MM_DD.
I would also like to ignore the first column in the output
Thus, the file 2011_05_13 will contain the following lines, 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 plan to do this in the linux box, so anything with any linux utilities would be cool, sed awk, etc.