open RH, "2.txt" or die $!; /^(.+?)\s*$/ and push @new_content, $1 while <RH>; close RH; open RH, "1.txt" or die $!; /^\d+\s*(.+?)\s*$/ and push @old_content, $1 while <RH>; close RH; open WH, ">1.txt" or die $!; for(@new_content){ $count++; print WH "$_ $old_content[--$counter]\n" }
In reply to Re: how to swap data from files
by sh1tn
in thread how to swap data from files
by cpiety
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |