-1

I have rows in a file which each one has 20 fields. At the 15th column of each row I need to do some insertions of special characters

x;x;x;x;x;x;x;x;x;x;x;x;x;YYYYY;x;x;x;x;x;x
x;x;x;x;x;x;x;x;x;x;x;x;x;YYYYY;x;x;x;x;x;x

could become

x;x;x;x;x;x;x;x;x;x;x;x;x;||YYYYY||;x;x;x;x;x;x
x;x;x;x;x;x;x;x;x;x;x;x;x;||YYYYY||;x;x;x;x;x;x

How could I do this?

iruvar
  • 16,725

1 Answers1

4

If you want to put "||" at the 15th collumn, you could do something like this:

awk -F ";" '{OFS=";"; $15="||" $15 "||"; print}' inputfile.txt