Extracting Date column from a csv file and aggregate rows according to date in different csv file
<p>I need an R script to separate the date column from a csv file, and to aggregate the rows with same date in separate date file.</p>

<p>Following is the structure of my csv file-</p>

<pre><code>dat &lt;- read.table(text = 
                    "2012-04-02 10:01:23.757,BALL,2012-04-20 00:00:00.000,0,0,0,4199,4180,10,4260,30
                  2012-04-02 10:01:23.763,GLOVES,2012-05-18 00:00:00.000,0,0,0,4369,4356,20,4424,10
                  2012-04-03 10:01:25.200,PAD,2012-04-20 00:00:00.000,0,0,0,4199,4190,10,4258,30
                  2012-04-03 10:01:26.360,WICKETS,2012-04-20 00:00:00.000,0,0,0,4199,4190,10,4255,20
                  2012-04-04 10:01:27.503,BELLS,2012-04-20 00:00:00.000,0,0,0,4199,4190,10,4255,30
                  2012-04-04 10:01:28.650,SHOES,2012-05-18 00:00:00.000,0,0,0,4369,4358,10,4424,10
                  2012-04-05 10:01:29.773,KITBAG,2012-04-20 00:00:00.000,0,0,0,4199,4190,10,4252,10
                  2012-04-05 10:01:29.777,HELMET,2012-05-18 00:00:00.000,0,0,0,4369,4359,20,4424,10", sep = ",")
</code></pre>

<p>This is just the small part of the csv file.
I want this complete file to be separated on the basis of date.</p>

<p>Ex- 
BALL and GLOVES having same date i.e 2012-04-02, so it should go under a single separate file namely 20120402.</p>

<p>Similarly for other dates also.</p>