Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cut from column X until the end of a tab delimited file

Tags:

linux

unix

cut

If I have a file with an unknown number of column but I know I want columns X til the end, is there an easy way to use cut for this?

Let us say X=5,

I used, cut -f5- filename but it did not work.

Then I am trying to specify the -d'\t' and also it does not work.

Not sure what I am doing wrong.

Any help will be greatly appreciated.

thanks!

like image 382
Dnaiel Avatar asked Oct 17 '12 00:10

Dnaiel


1 Answers

You're very close, but you're missing the dollar sign in there:

cut -d $'\t' -f5- file.txt
like image 109
Steve Avatar answered Sep 21 '22 12:09

Steve