I have a csv file where each row defines a room in a given building. Along with room, each row has a floor field. What I want to extract is all floors in all buildings. <
You can use a script I wrote called csvquote to let awk ignore the commas inside the quoted fields. The command would then become:
csvquote Buildings.csv | awk -F, '{print $1","$2}' | sort | uniq | csvquote -u > Floors.csv
and cut might be a bit easier than awk for this:
csvquote Buildings.csv | cut -d, -f1,2 | sort | uniq | csvquote -u > Floors.csv
You can find the csvquote code here: https://github.com/dbro/csvquote