myraja has asked for the wisdom of the Perl Monks concerning the following question:
The above is a molecular structure file. I need to extract molecular name, molecular weight ,formula, compound name and other data next to all > <something.. > from the file and load it in to MYSQL using CGI. tried RE.but...no luck...Please help. Thankz in advance...(+)-catechin SMI2MOL 21 23 0 0 0 0 0 0 0 0999 V2000 0.0000 0.0000 0.0000 O 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 C 0 0 1 0 0 0 0 0 0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 2 13 1 0 0 0 0 19 21 1 0 0 0 0 M END > <$NAM> (+)-catechin > <Formula> C15H14O6 > <MolWeight> 290.26806 > <ChemBankID> 1254 > <CompoundName> (+)-catechin > <Calbiochem Catalog> 219250 > <MicroSource Catalog> 210205 $$$$ (+)-himbacine SMI2MOL 25 28 0 0 0 0 0 0 0 0999 V2000 0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 C 0 0 2 0 0 0 0 0 0.0000 0.0000 0.0000 C 0 0 1 0 0 0 0 0 1 2 1 0 0 0 0 2 25 1 0 0 0 0 14 25 1 0 0 0 0 M END > <$NAM> (+)-himbacine > <Formula> C22H35NO2 > <MolWeight> 345.51884 > <ChemBankID> 1861 > <CompoundName> (+)-himbacine > <Calbiochem Catalog> 377200 $$$$ (+)-methamphetamine SMI2MOL 11 11 0 0 0 0 0 0 0 0999 V2000 0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 2 3 1 0 0 0 0 10 11 1 0 0 0 0 M END > <$NAM> (+)-methamphetamine > <Formula> C10H15N > <MolWeight> 149.23284 > <ChemBankID> 1568 > <CompoundName> (+)-methamphetamine > <MicroSource Catalog> 1900033 $$$$ ****************
Edited by Chady -- resurrected doctext.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: parsing using metacharacters
by graff (Chancellor) on Feb 19, 2004 at 06:47 UTC | |
|
Re: parsing using metacharacters
by BrowserUk (Patriarch) on Feb 19, 2004 at 06:59 UTC | |
|
Re: parsing using metacharacters
by kvale (Monsignor) on Feb 19, 2004 at 06:49 UTC | |
by Anonymous Monk on Feb 19, 2004 at 07:28 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |