
私は次の構造のtxtファイルで作業しています。
; $16
dc.b $FF
; $17
dc.b $FA
dc.b $65, $05
dc.b $F6
dc.w $0032 ; => Event1
dc.b $FF
; $18
dc.b $F4
dc.b $0F
dc.b "text"
dc.b $FC
dc.b "more text"
dc.b $FD
dc.b "more and more text"
dc.b $FD
dc.b "more and more and more text"
次のように、ファイル内のすべての引用符の間に含まれるすべてのテキストを新しいtxtファイルにコピーする方法を探しています。
text
more text
more and more text
more and more and more text
どんなアイデアがありますか?
事前にありがとう
答え1
簡単な方法は次のとおりですgrep
。
grep -oP '(").*(")' txt
P
Perl準拠の正規表現を使用し、一致するものだけをo
印刷します。
出力:
"text"
"more text"
"more and more text"
"more and more and more text"