Changing a CSV file in Korn shell

Hi All,

Please can someone help me how I can read a CSV file with 10 columns and remove the 2nd, 4th, 6th, 8th column and build the new output file. Script to be done in Korn shell.

File contains data like bnt, lb2, lb3, vnw, lb4, lb5, bst, lb6, lb7, vgw (multiple rows)

Output file should contain bnt, lb3, lb4, bst, lb7, vgw (multiple rows)

Thanks in advance.

-RiM

awk -F "," '{for(i=1;i<=NF;i++) if(i!=2 && i!=4 && i!=6 && i!=8) if(i<NF) printf("%s,",$i); else printf("%s%s",$i,"\n");}' <filename>

cut -d, -f1,3,5,7,9- file1 > file2