-1

I used following command on a file with 10 columns:

cut -f3 f1.tsv | sort | uniq -c | sort -k1,1 -nr > f2.tsv

which gave me a file like:

   1230 ABC
   1059 DEF
    846 GHI
    845 JKL

but now for some other work, i need just the second column.

So please tell me how can i use some simple, awk or cut command to get it.

Shweta
  • 1,111
  • 3
  • 15
  • 30
  • 1
    `man cut`, then read the examples at the bottom. – Mr. Llama Mar 31 '15 at 19:54
  • so i could use something like: cut -c9-100 f2.tsv. But i will have to check "9" always and also how to know "100" if line is too big. – Shweta Mar 31 '15 at 19:59
  • @Ed, I know how simple it is to get desired output from f1.tsv. The thing is that i need it from f2.tsv. Because of some reasons the information i have is just f2.tsv and I explained how it has been generated. And now i need desired output from f2.tsv only. – Shweta Apr 01 '15 at 06:04
  • Sorry Ed.. But it was not for wasting the time.. i thought it other way around. I thought it will give reference, and most probably people must be using such commands frequently, so they will quickly respond. – Shweta Apr 01 '15 at 06:33

1 Answers1

0

There's no need of those continues commands and pipes. Post some sample contents of f1.tsv and the final desired output.