I have a file (input.txt) with columns of data separated by spaces. I want to get the 9th column of data and onwards.
Normally I would do:
cut -d " " -f 9- input.txt
However, in this file, sometimes the fields are separated by multiple spaces (and the number of spaces varies for each row / column). cut doesn't seem to treat consecutive spaces as one delimiter.
What should I do instead?
sed -r 's/ +/ /g' input.txt|cut -d " " -f 9-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With