I often need to run various scripts which edit the data inside a CSV file, but restricted to only a particular column within that file. Redesigning all of the scripts so that they only manipulate a particular column is sometimes complicated. I think the simplest method is to output the particular column to a temporary file, such as temp.csv, run the scripts on temp.csv, then place this edited data back into the same column in the CSV file.
I know that I can retrieve just the data from a particular column of a CSV file using this:
awk -F@ '{print $3}' file.csv >> temp.csv
After editing temp.csv with the scripts, what is the simplest way to return this data back to the same column in the CSV file?
You can modify
$3in place. E.g.: