awk: how to delete first and last value on entire column -
I have a data that contains many columns. On a column, I would like to delete two commas which, at the beginning and in the whole Are located at the end of the column. My data looks something like this:
a, 3,4,3,2, b, 3,4,5,1, c, 1,5,2,4,5, d , 3,6,24,62,3,54, How can someone remove the first and last comma on this data? I appreciate it.
awk '{sub (/, /, "", $ 0); Print substrag ($ 0,0, length ($ 0) -1)} 'input.txt Output:
a 3,4,3 , 2, b3,4,5,1, c 1,5,2,4,5, d3,6,24,62,3,54,
Comments
Post a Comment