2 つの異なる言語の 2 つのテキスト ファイルがあり、行ごとに並べられています。つまり、textfile1 の最初の行は textfile2 の最初の行に対応し、以下同様です。
両方のファイルを 1 行ずつ同時に読み取る方法はありますか?
以下は、ファイルがどのように見えるかのサンプルです。ファイルあたりの行数が約 1,000,000 であると想像してください。
テキストファイル1:
This is a the first line in English
This is a the 2nd line in English
This is a the third line in English
テキストファイル 2:
C'est la première ligne en Français
C'est la deuxième ligne en Français
C'est la troisième ligne en Français
希望の出力
This is a the first line in English\tC'est la première ligne en Français
This is a the 2nd line in English\tC'est la deuxième ligne en Français
This is a the third line in English\tC'est la troisième ligne en Français
このRead two textfile line by line同時に -javaのJavaバージョンがありますが、Pythonは行ごとに読み取る bufferedreader を使用しません。では、それはどのように行われるのでしょうか?