Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, I am bit stuck with a process, actually I have a tab separated file wi +th 3 columns(shown below), what I am trying to do is read this file a +nd the sending column 3 values to a database on the internet and when + the files are recieved it should write in a file in the directory wi +th the name of the directory as column1_column2(Ex: reme_9625) and th +is process should be done for whole file.
open(FH,"upload") or die "Check The File"; while(<FH>) { chomp $_; my @temp = split(/\t/,$_); my $gene=$temp[0]; my $geneid=$temp[1]; my $string=$temp[2]; mkdir "$gene-$geneid" or die "Could not make the directory"; print "$gene-$geneid\n"; }
File looks like<br> REME 9625 17[CHR] AND 76705160:76721740[CHRPOS] ABNM 369 X[CHR] AND 47305522:47316264[CHRPOS] BCKD 1029 16[CHR] AND 31027249:31031422[CHRPOS]
Actually I am a new to perl and past 3 days I am trying to work it out +. Any help will greatly be appreciated...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: automatic web query and writing files in a directory
by moritz (Cardinal) on Jun 07, 2007 at 17:29 UTC | |
by Anonymous Monk on Jun 07, 2007 at 17:34 UTC | |
by moritz (Cardinal) on Jun 07, 2007 at 18:14 UTC | |
|
Re: automatic web query and writing files in a directory
by Grundle (Scribe) on Jun 07, 2007 at 20:57 UTC | |
by Anonymous Monk on Jun 07, 2007 at 21:21 UTC | |
by planetscape (Chancellor) on Jun 08, 2007 at 03:36 UTC | |
by Grundle (Scribe) on Jun 08, 2007 at 16:07 UTC |