だから私はファイル(数千行)input.txtに次の出力を持っています
2956:1 1076:1 4118:1 1378:1 2561:1
1039:1 1662:1
1948:1 894:1 1797:1 1662:1
問題は、各行を昇順でソートする必要があることです
望ましい出力: output.txt
1076:1 1378:1 2561:1 2956:1 4118:1
1039:1 1662:1
894:1 1662:1 1797:1 1948:1
これは、私のためにこれを行うためのpython関数を探しています。行は順番どおりに並べる必要がありますが、各行は (出力と同様に) 昇順で並べ替える必要があります。
これを行う方法についてのアイデアはありますか?