in reply to how to swap data from files

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" }

Replies are listed 'Best First'.
Re^2: how to swap data from files
by cpiety (Novice) on Feb 02, 2005 at 22:53 UTC
    Hi, the code you posted is nicely changing the date stamp to a format I can use but it is also rearranging the data in a way I can not understand. It seems like there are 3 repeating blocks of data with the same date time stamp that have all different data. thanks again