(1). cut
# extract several columns from a tab-delimited file
# You can try to place a tab between the quotes if you first press "
cut -f 1-10 -d "
# extract column 1 and column 3 from big_file to a subset_file
cat big_file | cut -f 1,3 -d " " > subset_file
(2). awk
# extract column 1 and 3 with all cell including M of big_file to subset_file
cat Agu-1_fv.txt | grep M | awk '{ print $1, $3}' > subset_file
没有评论:
发表评论