How can I get 2nd and third column in tab delim file in bash?

前端 未结 3 1733
旧时难觅i
旧时难觅i 2020-12-29 03:01

I want to use bash to process a tab delimited file. I only need the second column and third to a new file.

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-29 03:41

    expanding on the answer of carl-norum, using only tab as a delimiter, not all blanks:

    cut -d$'\t' -f 2-3 input.txt > output.txt
    

    don't put a space between d and $

提交回复
热议问题