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.
この形式のテキストファイルがあります。
('1', '2', '3', '4', '5'); ('a', 'b', 'c', 'd', 'e');
等...
各行から、の3番目と4番目のエントリが必要です。''
''
私のテキストファイルは125k行あるので、何か大きなものです。
ありがとうございました
^.*?,.*?,(.*?),(.*?),.*
\1と\2の3番目と4番目のフィールドが表示されます(引用符の間にコンマが表示されない、区切り文字として扱われないようにするなどの場合)。
あなたの例で実行し、を置き換えると\1,\2、最終結果は次のようになります。
\1,\2
'3', '4' 'c', 'd'