I have a 30 column tab delimited record file. I need to extract the first 10column. The following command to cut was not working
cut -f 1-10 -d "\t" filename.
Could any one keep on this .
Thanks in Advance
I have a 30 column tab delimited record file. I need to extract the first 10column. The following command to cut was not working
cut -f 1-10 -d "\t" filename.
Could any one keep on this .
Thanks in Advance
I have also tried the following command also
cut -f 1-10 -d "&H09" filename
awk -F"\t" '{ for ( i=1; i<=10; i++ ) { printf "%s\t", $i } printf "\n"; }' filename
Thread IT Resource Center forums - Remove columns in file asks almots an identical question.
Responses available with both perl and awk
# awk -F'\t' 'NR>1 {for(i=1;i<=20;++i) printf(i<20?"%s\t":"%s\n",$i)}' ofile
# perl -nle 'print if $.==1;@a=split;print join "\t", @a[0..19] file
You can try to place a tab between the quotes if you first press "<CTR> v" then the "<TAB>" key:
cut -f 1-10 -d "<CTR>v <TAB>"
Regards