Extracting columns from text file with different delimiters in Linux

前端 未结 2 1888
礼貌的吻别
礼貌的吻别 2020-12-05 02:28

I have very large genotype files that are basically impossible to open in R, so I am trying to extract the rows and columns of interest using linux command line. Rows are st

2条回答
  •  渐次进展
    2020-12-05 02:55

    You can use cut with a delimiter like this:

    with space delim:

    cut -d " " -f1-100,1000-1005 infile.csv > outfile.csv
    

    with tab delim:

    cut -d$'\t' -f1-100,1000-1005 infile.csv > outfile.csv
    

    I gave you the version of cut in which you can extract a list of intervals...

    Hope it helps!

提交回复
热议问题