I have a SED problem beyond my knowledge. I have a solar plant that generates CSV files in the format
2012-01-08;00:00;171,297;0,000;
2012-01-08;00:05;171,297;0,000;
2012-01-08;00:10;171,297;0,000;
2012-01-08;00:15;171,297;0,000;
2012-01-08;00:20;171,297;0,000;
2012-01-08;00:25;171,297;0,000;
I'm importing these values in a MySQL database. I would like to have a combination of the 2 first values to act as a unique primary key.
The result should look like:
2012-01-08;00:00;171,297;0,000;2012-01-08-00:00
2012-01-08;00:05;171,297;0,000;2012-01-08-00:05
2012-01-08;00:10;171,297;0,000;2012-01-08-00:10
2012-01-08;00:15;171,297;0,000;2012-01-08-00:15
2012-01-08;00:20;171,297;0,000;2012-01-08-00:20
sed
?