#! /bin/bash Input1="coc81_bootstrapped_ab_pairs.csv" Input2="nasa93_bootstrapped_ab_pairs.csv" Output1="coc81_1k.csv" Output2="nasa93_1k.csv" Output3="coc81_300.csv" Output4="nasa93_300.csv" gawk 'BEGIN{FS=",";OFS=" "}NR<=1000{print $1,$2}' $Input1 > $Output1 gawk 'BEGIN{FS=",";OFS=" "}NR<=1000{print $1,$2}' $Input2 > $Output2 gawk 'BEGIN{FS=",";OFS=" "}NR<=300{print $1,$2}' $Input1 > $Output3 gawk 'BEGIN{FS=",";OFS=" "}NR<=300{print $1,$2}' $Input2 > $Output4