in reply to Re: processing a lot of files
in thread processing a lot of files
Thanks!my $dir = 'C:/Documents and Settings/mydir/Desktop/current/Test_Files' +; # directory to search opendir my $dh, "$dir"; my $i=1; while(my $f = readdir($dh)) { next if -d "$dir/$f"; open(my $in, "$dir/$f"); open(my $out, ">C:/Documents and Settings/mydir/Desktop/current/T +est_Files/outfiles/data$i"); my $firstline = <$in>; chomp $firstline; while(my $line = <$in>){ chomp $line; my ($well_position,$sample,$barcode,$block_id) = split(/\t/, $ +line); my $name = substr($block_id, 11); $sample =~ /(\d+)(.*)|(\D\d))/; print $out "$well_position\t$1\t$2\t$barcode\t$name\n"; } $i++; close($in); close($out); } closedir($dh);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: processing a lot of files
by toolic (Bishop) on Jul 29, 2009 at 00:20 UTC | |
|
Re^3: processing a lot of files
by scorpio17 (Canon) on Jul 29, 2009 at 13:11 UTC |