Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のファイルがあります
ENST001 ENST002 4 4 4 88 9 9 ENST004 3 3 3 99 8 8 ENST009 ENST010 ENST006 8 8 8 77 8 8
基本的に、各行で ENST* が繰り返される回数を数えたいので、期待される結果は
2 1 3
何か提案はありますか?
これを試してください(そしてここで実際に動作するのを見てください):
awk '{print gsub("ENST[0-9]+","")}' INPUTFILE