I have an csv file that looks like:
id, name, nationality 1, Maria, ESP 2, John, NED 3, Alice, DEN
I am building a document script.sed that executes different sed expressions like this:
s/ESP/Spain/g s/DEN/Denmark/g s/NED/Netherlands/g
I run the sed script through:
sed -f script.sed "file.csv"
The expressions above work as I expected, however I need to include the csv headers in the output. Is there any way to print them in a sed expression and introduce it in the script.sed file?
I have this output:
1, Maria, Spain 2, John, Netherlands 3, Alice, Denmark
but I need this output:
id, name, nationality 1, Maria, Spain 2, John, Netherlands 3, Alice, Denmark