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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.