我真的很抱歉,我在用老一套的問題 - AWK和sed使用awk修改文本文件或sed的或兩者(再次)
我想轉換含有大量的文本文件:
>hg19_ct_UserTrack_3545_12513 range=chr1:52035541-52035716 5'pad=0 3'pad=0 strand=+ repeatMasking=none
CACACATACTTTTATTCAAGCCTCAGAGCAACCCTGCAAAATGAGTATTA
TCTCCACTTTACAATCAGGAGGCTGAGTCATAAGGAGGTGAGTCACCTGC
CTAGGGCCACATAGCTAGCAAGGAGCCAAGCTGGAATTTTAAGCCACGTT
TGTCTGATTCTTTCTGCATACCATGC
>hg19_ct_UserTrack_3545_13212 range=chr1:186122154-186122314 5'pad=0 3'pad=0 strand=+ repeatMasking=none
ATCTTCAGGGACAAGTTTTTACAAACTCTCTTAATGGTTTTACCACCCTC
CCTATCAGGACCAAGATCAAATACTTGATGTAAGGCATTTGTTTAATTTT
CTTTAGACAAAGAGGATAGTAATTCTTGCATAAACGTTTTTGTGTATCAT
CCATAAAATAT
等,等
要:
>range=chr1:52035541-52035716 5'pad=0 3'pad=0 strand=+ repeatMasking=none
CACACATACTTTTATTCAAGCCTCAGAGCAACCCTGCAAAATGAGTATTA
TCTCCACTTTACAATCAGGAGGCTGAGTCATAAGGAGGTGAGTCACCTGC
CTAGGGCCACATAGCTAGCAAGGAGCCAAGCTGGAATTTTAAGCCACGTT
TGTCTGATTCTTTCTGCATACCATGC
>range=chr1:186122154-186122314 5'pad=0 3'pad=0 strand=+ repeatMasking=none
ATCTTCAGGGACAAGTTTTTACAAACTCTCTTAATGGTTTTACCACCCTC
CCTATCAGGACCAAGATCAAATACTTGATGTAAGGCATTTGTTTAATTTT
CTTTAGACAAAGAGGATAGTAATTCTTGCATAAACGTTTTTGTGTATCAT
CCATAAAATAT
我試過awk 'NR==1{sub(/^[^ ]* /,"")} 1'
和sed -i '1s/\w\+ //'
但沒有任何工作。
那麼,這些多行記錄?我以爲他們只是爲了演示而包裝。如果是這樣,記錄的開始是什麼,類似於** hg19_ct_UserTrack_3545_13212 **?最後的結果只是一個很長的字符串,沒有那些UserTrack字段? – mjuarez 2013-02-11 11:04:51