# Swap columns 1 and 2 in a csv file (delimiter is comma ",")
awk -F"," 'BEGIN { OFS = "," } { temp = $1; $1 = $2; $2 = temp; print }' input.csv > output.csv
# Swap columns 1 and 2, replacing tab delimiters "\t" with pipe "|"
awk -F"\t" 'BEGIN { OFS = "|" } { temp = $1; $1 = $2; $2 = temp; print }' input.csv > output.csv