Google Answers Logo
View Question
 
Q: Import XML into Mysql ( No Answer,   3 Comments )
Question  
Subject: Import XML into Mysql
Category: Computers > Programming
Asked by: sief-ga
List Price: $20.00
Posted: 10 Feb 2005 07:24 PST
Expires: 12 Mar 2005 07:24 PST
Question ID: 472297
How do I convert the data from this site ftp://ftp.fedbizopps.gov/ and
upload it to the database on my site (MySQl) I want to make this
information available to my visitors in a nice searchable format.

This is all the instructions I receieved.
In Netscape, the feed will open in template form by clicking on the feed for
that day.

In Internet Explorer, the feed will open in text format by clicking on the feed
for that day.  To view in template format, click on 'View' and 'Source'.  

You can review the file templates by going to www.fedbizopps.gov, clicking on
'General Information', then 'Interface Description'.  The link to this
information is below:

http://www.eps.gov/pilotGeneralInfo/Overview.html

You can click on each template link for additional information.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Import XML into Mysql
From: billotte-ga on 14 Feb 2005 04:37 PST
 
I would write a Perl (or whatever your favorite scripting language is)
script that reads each record from each file in the directory listing
that comes up given the URL that you provided.

The basic pseudocode would be:

- get page at base URL
- for each file listed on base page:
  - load file
  - for each record in the file aka for each set of <PRESOL>...</PRESOL> tags:
    - read each field
    - insert record into DB

If you choose to use Perl, the functionality of the DBI module would
make this almost trivial to write. Other scripting languages will have
a similar interfaces.

If programming is not your gig, there are visual tools out there that
would probably work as well. I use Kapow (http://www.kapowtech.com/)
at work for such things, but it doesn't seem to handle FTP very well.
It is more http/html oriented.
Subject: Re: Import XML into Mysql
From: billotte-ga on 14 Feb 2005 04:40 PST
 
additional point on visual tools: don't know how other tools rate
cost-wise, but Kapow is NOT cheap! Work pays for us to use it, but for
what it costs, I would write code if I needed to do it for personal
purposes.
Subject: Re: Import XML into Mysql
From: leegee-ga on 06 Mar 2005 02:22 PST
 
I would use perl, with LWP::UserAgent to get the data, and the
XML::Simple module to read it. The data is so nicely formed that
XML::Simple has no problems turning it into a perl variable, and then
it is a piece of cake to use DBI to put it into MySQL. It's about an
hour's work, at most.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy