>>130
質問に具体性がないから一般論を書いただけだけど。

>>129
awk '/東京(.+?)号室/ {print > "TEST.txt";}' AAA.txt
awk '/東京(.+?)号室/ {print >> "TEST.txt";}' BBB.txt
以下同様に。