I have a CSV file that looks like this:
"12345","TestTest","1.2","TestTest
"
I want to add a date such as YYYY-MM-DD HH:MM:SS to either the beginning or the end of the CSV file. As you can see in the example above, the double quote (") encases the values on the columns and the comma (,) delineates each column. The problem is the double quote at the end of the line is always on a new line. This means that when I've tried to use sed to search/replace based on a single double quote, my replacement ends up not only at the start of the line, but also at the end of the line.
My next theory is if its possible to use some tool (sed, awk, whatever) to add in the date only when the beginning of the CSV line is a double quote and a number ie: "12345", so the new line looks like:
"YYYY-MM-DD HH:MM:SS","12345","TestTest","1.2","TestTest
"
NOTE: This command you suggest should apply this change to every line in the CSV file. This also needs to be run via linux command line.
Thanks,