


Then it prints the entire array with semi-colons as the field separator. Then it replaces the fourth-last and third-last fields with a single string containing the values of both fields separated by a comma. This splits the line into the array, using as the separator.

$ perl -F' ' -lane 'splice print input.csv Sed is good when you're working with entire lines, but awk and perl are better when you need to work with fields/columns within a line.
