Input filejayesh  30,20,50,60 30:20:40,60:55  A   AB,KL,CD        SM1,SM2rahul   10,80,50,90 25:55:60,25     SGF AAAA,BCD,RTY    SM3,SM4,SM4pravin  89,78,40,20 25:30:55,96:25  M   J               SD10,SD12sarika  10,20,48    29:50:30,25     T   K,L             SD20,SD39I want remove comma's from column 5 and print those words in new line which are present after the comma(Note:- each single cell of the 5th column contains many comma's but i show only few)Expected outputjayesh  30,20,50,60      30:20:40,60:55 A   AB   SM1,SM2jayesh  30,20,50,60      30:20:40,60:55 A   KL   SM1,SM2jayesh  30,20,50,60      30:20:40,60:55 A   CD   SM1,SM2rahul   10,80,50,90,120  25:55:60,25    SGF AAAA SM3,SM4,SM4rahul   10,80,50,90,120  25:55:60,25    SGF BCD  SM3,SM4,SM4rahul   10,80,50,90,120  25:55:60,25    SGF RTY  SM3,SM4,SM4pravin  89,78,40,20      25:30:55,96:25 M   J    SD10,SD12sarika  10,20,48         29:50:30,25    T   K    SD20,SD39sarika  10,20,48         29:50:30,25    T   L    SD20,SD39I tried the following using awk but not giving expected results. (to write code i take help from this site How to remove the comma and print the entire row again for the words which are place after the comma)awk '{split ($5,w5,,);for (i in w5) { print $1\t$2\t$3\t$4\tw5[i]\t$6;}}'@sundeep, when i tried the following command for my input file, 5th and 6th column get mixed with each other.(i just show here total 6 columns but my file have more than 6 columns) following output is obtained when i open the output file in exceloutput$ awk '{ split ($5,w5,,); for (i in w5) { print $1\t$2\t$3\t$4\tw5[i]\t$6 } }' ip.txtjayesh  30,20,50,60 30:20:40,60:55  A   ABSM1,SM2 jayesh  30,20,50,60 30:20:40,60:55  A    KL         SM1,SM2jayesh  30,20,50,60 30:20:40,60:55  A    CD        SM1,SM2rahul   10,80,50,90 25:55:60,25     SGF  AAAASM3,SM4,SM4   rahul   10,80,50,90 25:55:60,25     SGF  BCD        SM3,SM4,SM4rahul   10,80,50,90 25:55:60,25     SGF  RTY       SM3,SM4,SM4pravin  89,78,40,20 25:30:55,96:25  M    J          SD10,SD12sarika  10,20,48    29:50:30,25     T    KSD20,SD39    sarika  10,20,48    29:50:30,25     T    L         SD20,SD39
Remove the multiple comma's from specific column of tab delimited fileand print the words on new line
linux;sed;awk
The awk command used by OP just has syntax issue, the ; at end of print statement$ awk '{ split ($5,w5,,); for (i in w5) { print $1\t$2\t$3\t$4\tw5[i]\t$6 } }' ip.txtjayesh  30,20,50,60 30:20:40,60:55  A   AB  SM1,SM2jayesh  30,20,50,60 30:20:40,60:55  A   KL  SM1,SM2jayesh  30,20,50,60 30:20:40,60:55  A   CD  SM1,SM2rahul   10,80,50,90 25:55:60,25 SGF AAAA    SM3,SM4,SM4rahul   10,80,50,90 25:55:60,25 SGF BCD SM3,SM4,SM4rahul   10,80,50,90 25:55:60,25 SGF RTY SM3,SM4,SM4pravin  89,78,40,20 25:30:55,96:25  M   J   SD10,SD12sarika  10,20,48    29:50:30,25 T   K   SD20,SD39sarika  10,20,48    29:50:30,25 T   L   SD20,SD39Also, can set output field separator for a cleaner syntax, thanks @fedorqui for the suggestionawk -v OFS='\t' '{ split ($5,w5,,); for (i in w5) { print $1,$2,$3,$4,w5[i],$6 } }' ip.txtorawk -v OFS='\t' '{ split ($5,w5,,); for (i in w5) { $5 = w5[i]; print } }' ip.txtSimilar solution with perl$ perl -lane 'print join \t, @F[0..3],$_,@F[5..$#F] foreach split /,/,$F[4]' ip.txt jayesh  30,20,50,60 30:20:40,60:55  A   AB  SM1,SM2jayesh  30,20,50,60 30:20:40,60:55  A   KL  SM1,SM2jayesh  30,20,50,60 30:20:40,60:55  A   CD  SM1,SM2rahul   10,80,50,90 25:55:60,25 SGF AAAA    SM3,SM4,SM4rahul   10,80,50,90 25:55:60,25 SGF BCD SM3,SM4,SM4rahul   10,80,50,90 25:55:60,25 SGF RTY SM3,SM4,SM4pravin  89,78,40,20 25:30:55,96:25  M   J   SD10,SD12sarika  10,20,48    29:50:30,25 T   K   SD20,SD39sarika  10,20,48    29:50:30,25 T   L   SD20,SD39