CVS file operation in Perl

Hi All,

I have one CVS file, and doing some actions on it. I have removed some columns by

SWITCH: {
                          $column eq 'COL1' && do {next;};
                          $column eq 'COL2' && do {next;};
                          push(@columns, $column);
                        }

Now I want to shift COL3 to last column. i.e.

Input:
COL23,COL3,COL21

Output:
COL23,COL21,COL3

Please help!!

---------- Post updated at 02:25 AM ---------- Previous update was at 12:31 AM ----------

no worries dudes.... done with the solution...
:slight_smile:

By shell:

$ echo "COL23,COL3,COL21" |awk -F[,] '{print $1,$3,$2}' OFS=","
COL23,COL21,COL3