
AwsedreswA
New User
Jan 5, 2014, 6:16 AM
Post #4 of 5
(17606 views)
|
Re: [BillKSmith] Help me code this logic please
[In reply to]
|
Can't Post
|
|
Here is where I am at now. It'd be nice to have progress indicator. It would also be nice to do more than just one coordinate at a time since I have to wait forever to read off a USB 2.0 HDD. Im guessing this is hard and would require array work.
$out_file="C:\\perl\\scripts\\bluetime.txt"; # out_file is the output file name #$out_file="C:\\perl\\scripts\\bluetime.txt"; # uncomment and put your source here!!!! unlink $out_file; # erased (deletes) the output file FIRST, # otherwise it will continue to append to it! open ($output_file,">>",$out_file) or die "Could not open output_file!!!"; #open file for append for ($i=1;$i<=60075;$i++) # files 00000.txt thru 60075.txt { $output_name = sprintf("%05d",$i); # first field in bluetime, 5 digits $input_file = sprintf("G:\\Frames_as_RGB_Tuples\\%05d.txt",$i); # FQ input filename # $input_file = sprintf("C:\\perl\\scripts\\%05d.txt",$i); open ($infile, "<",$input_file) or die "Could not open input file $input_file!!!"; ## "<" means read from, ">>" means append to, ">" means write to! # printf("G:\\Frames_as_RGB_Tuples\\%s.txt\n", $result); while(<$infile>) # read one line from infile, put in $_ { if($_ =~ /^390\t379/) { # print $_; # print sprintf("%s\t-->%s<--\n",$output_name,$_); print $output_file sprintf("%s\t%s",$output_name,$_); #5 digits plus tuple } } close $infile; } close $output_file;
(This post was edited by AwsedreswA on Jan 5, 2014, 6:16 AM)
|