in reply to parsing using metacharacters

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: parsing file using metacharacters -new
by Abigail-II (Bishop) on Feb 19, 2004 at 11:58 UTC
    My problem is : To parse a chemical file and load it in to the mysql database using CGI.

    ...

    I will be happy if you can offer full source code completely tested.

    How much are you willing to pay?

    Abigail

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: parsing file using metacharacters -new
by punkish (Priest) on Feb 19, 2004 at 21:40 UTC
    Myraja,

    Everyone makes a mistake, and you have made one. In case you haven't figured it out -- it seems like you are not asking for help but are asking others to do your work/hobby for you. This is evident from your statement -- "I will be happy if you can offer full source code tested for result." It is also not clear that you really tried even though you say -- "I tried with arrays...but had problems when the full file size exceed several 100 mb as it used lot of memory RegEx didnt me fetch good luck."

    Any community is only as good as its members, and you are one of them. If you want to benefit, you have to give back. And, you have to respect others.

    Some may sound harsh, some may be gentle. But no one wants to be taken advantage of. And everyone respects a hardworker, a sincere sounding person, and one who takes his/her own responsibilities seriously.

    Go back, try out the problem. Come back and apologize to the community. Post your code that you wrote, post your results, ask for specific advice on how to improve it. Trust me, everyone will appreciate you and welcome you. And you and Perl will be happy together.

    Be sure to read "How to ask questions on newsgroups" or "How to not have questions go unanswered" -- just type these phrases in Google and you will get good pointers.

    Good luck.

Re: parsing file using metacharacters -new
by castaway (Parson) on Feb 19, 2004 at 12:06 UTC
    This should have been post as a reply to parsing using metacharacters.

    Can you post your code so we can see which part of it is giving you problems? Just reading the file and printing the data (just storing each chemical and not all) shouldnt use a lot of memory. Likewise if you save the data to the database as you read each one, that shouldnt be a problem.

    What did you mean with 'using CGI'?, CGI isnt necessary to write data to a MySQL database.

    C.

Re: parsing file using metacharacters -new
by Gyro (Monk) on Feb 20, 2004 at 00:48 UTC
    myraja
    I agree with the previous posts. If you want more you need to give more, show your work. We don't mind sharing code, we just need to see where you are to help you take the next step.

    Now, this is what I'm going to give to you. What you are attempting to do is what I do quite often.

    As you notice the data you are looking for comes in triplets.

    • > <Formula>
    • C10H15N
    • > <MolWeight>
    • 149.23284
    • > <ChemBankID>
    • 1568
    Each triplet makes one record and lucky you it's looks like a set pattern: Formula, MolWeight then ChemBankID. Recurse through your file and look for the pattern capture the data. After you capture each data set print then load. You don't need to hold on to the data unless you can batch it in(me not knowing how MySQL works) or you need to prevent duplicates, there you can use a hash.

    As far as MySQL - read the docs, here's a good start if you are using perl to load it: DBI and DBD::mysql.
    Cheers,
    Gyro

Re: parsing file using metacharacters -new
by Skeeve (Parson) on Feb 19, 2004 at 12:38 UTC
    Is it homework???
    A reply falls below the community's threshold of quality. You may see it by logging in.