ashnator has asked for the wisdom of the Perl Monks concerning the following question:
I have got 2 files which I need to parse based on certain features but the files are too big as much as 3 GB so I am unable to use array or even storage variables.
The format of the 2 files with example is :-
1) File format of one file :2) File format of the second file is :>Harvard 32384743 234394583 John1 15.T >MIT 13249304 545924582 Smith32 7.A >Cambridge 76323823 983438434 Gold1234 17.G
Now this 15.T , 7.A and 17.G are the locations in the second files. e.g, 15.T means 15th position in John1 record of file file 2. Now I have to apply this formula that any locations score should be >= 20. If so I have to display its name in the output file:->John1 40 34 40 40 25 40 40 40 40 17 40 40 40 20 40 40 40 20 40 40 40 30 40 4 +0 19 40 40 40 37 40 11 40 40 35 25 40 >Smith32 40 40 44 13 40 40 40 50 40 40 40 40 50 40 40 40 16 40 6 40 40 45 40 40 + 40 2 40 40 40 40 29 40 40 40 6 40 >Gold1234 40 40 15 40 39 40 40 40 40 66 40 40 35 40 40 40 10 40 40 40 40 27 40 4 +0 40 12 40 40 33 40 40 40 40 4 40 40 --------------------------- END -------------------------
For Example 15.T means 15th location in John1 record in File 2. Since the 15th position is 40 which is greater than 20 my result should come like this:-
3) Output FileJohn1 15.T 40
My PERL knowledge is basic so I would be obliged to get help from Monks. Please remember that I cannot store anything in arrays or variables since I have to parse 3 GB file.
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing of 3 GB File
by Perlbotics (Archbishop) on Oct 19, 2008 at 09:41 UTC | |
|
Re: Parsing of 3 GB File
by wfsp (Abbot) on Oct 19, 2008 at 09:42 UTC | |
|
Re: Parsing of 3 GB File
by CountZero (Bishop) on Oct 19, 2008 at 14:32 UTC | |
|
Re: Parsing of 3 GB File
by Anonymous Monk on Oct 19, 2008 at 11:46 UTC | |
|
Re: Parsing of 3 GB File
by binf-jw (Monk) on Oct 19, 2008 at 12:36 UTC | |
|
Re: Parsing of 3 GB File
by hangon (Deacon) on Oct 19, 2008 at 14:58 UTC | |
|
Re: Parsing of 3 GB File
by JavaFan (Canon) on Oct 19, 2008 at 19:08 UTC | |
|
Re: Parsing of 3 GB File
by talexb (Chancellor) on Oct 20, 2008 at 02:02 UTC | |
by Anonymous Monk on Oct 20, 2008 at 07:30 UTC |