Linux
- 以列為單位合并兩個文件
paste file1 file2 > output.txt
- 使用awk提取文件中某兩列有多少相同元素
awk 'NR>1{if($1==$2) {count++; print NR}} END{print count}' 123 | wc -l
- 使用awk提取文件中第一行中包括特定元素的字符串所對應的列的內容
awk 'NR==1 {for(i=1;i<=NF;i++) {if($i ~ /11/) {cols[i]=1}}} {for(i in cols) printf("%s ",$i); printf("\n")}' 123 | less -S
- 使用split將文件拆分成特定行數(shù)或者特定大小的文件
Linux命令之文件分割split命令
eg.
split -l 10000 SPS-01.fq SPS-01