このフォーラムで見つけた、テキスト ファイルから列を抽出するためのこの Perl ワンライナーがあります。
perl -ane "print qq(@F[0,1,3,4]\n)" ./folder/input.txt
> ./short_files/output.txt
名前を持つ 352 個の入力ファイルでこれを実行し、名前input1.txt, input2.txt,...,input352.txt
を持つ 352 個の出力ファイルを生成する必要がありますoutput1.txt, output2.txt,..., output352.txt
。
入力と出力のファイル名が毎回変わるループで Perl ワンライナーを実行できるように、ラッパー コードを手伝ってくれる人はいますか?