To swap column 2 and 3 in a 4 column file:
OFS: indicates the separator character(';' in the example above).
FILE: original file.
NEW_FILE: new file with the changes.
awk -F, '{print $1,$3,$2,$4}' OFS=; "FILE" > NEW_FILEwhere:
OFS: indicates the separator character(';' in the example above).
FILE: original file.
NEW_FILE: new file with the changes.