in reply to Re: processing a lot of files
in thread processing a lot of files
my $dir = "dir/files"; opendir my $dh,"$dir"; my @files = raddir $dh; for my $f(@files){ #Each file is the same format. #so, I should be able reformat # with read, and write here #currently I am using: my $i = 1; open (my $out, $f); while(<$_>){ my @fields = split /\t/; my $well_position = $fields[0]; my $sample = $fields[1]; $sample =~ /(\d+)(.*)/; my $barcode = $fields[2]; my $block_id = $fields[3]; my $name = substr($block_id,11); my $outfile = "$out$i"; print Fi "$well_position\t$1\t$2\t$barcode\t$name\n"; } $i++; } closedir($dh);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: processing a lot of files
by Utilitarian (Vicar) on Jul 28, 2009 at 20:12 UTC |