Scripting issue
Hello,
I have an ASCII file (many files of the same format, but different dates and numbers) in the format like below:
2008.01.02,08:00,1.46520,1.46520,1.46410,1.46440,70
2008.01.02,08:05,1.46450,1.46560,1.46440,1.46540,79
2008.01.02,08:10,1.46530,1.46540,1.46490,1.46500,46
2008.01.02,08:15,1.46490,1.46500,1.46470,1.46500,43
2008.01.02,08:20,1.46510,1.46600,1.46500,1.46580,44
. . .
Here 2008 - is a year. Other lines might start with year 1999 or 2004, etc.
Need to convert it to the following style:
2008-01-02 08:00 1,46520 1,46520 1,46410 1,46440 70
2008-01-02 08:05 1,46450 1,46560 1,46440 1,46540 79
2008-01-02 08:10 1,46530 1,46540 1,46490 1,46500 46
2008-01-02 08:15 1,46490 1,46500 1,46470 1,46500 43
2008-01-02 08:20 1,46510 1,46600 1,46500 1,46580 44
. . .
After that need to split the new file according to a year (and move each one to its own directory - "2008" or "1999", "2004" and so on).
I have Ubuntu installed, so perl, awk or whatever should be there (unfortunately I'm not familiar with how to programming them). Maybe anybody can help with this task.
Thank you!