Matt Royer wrote in post #961585:
> I have attached a ruby program built to get the xml data out of files
> and display the text back to me on the screen. This program was built
> from a few different sources, as I'm still new with the Ruby language.
> But I have monkeyed around with it enough and have got it working how I
> want it.
>
> What I'm trying to do is get this information into a database so I can
> search it using a web interface (through Rails of course).
>
> Here is a sample of the data that is spit out to the screen when I run
> the program:
>
> ----
>
> //dc5/IP Office Calls/38/73/387398.xml
> <starttime>2009-05-05 15:28:47:000 -0600</starttime>
>
> <endtime>2009-05-05 15:32:50:000 -0600</endtime>
>
> <calldirection>Incoming</calldirection>
>
> <filename>387398.wav</filename>
>
> <recordingowner>5297</recordingowner>
>
> <party id="1">
> <number>5557915555</number>
> <name/>
> </party>
>
> <party id="2">
> <number>5297</number>
> <name>FredJones</name>
> </party>
>
> ----
>
> What is the best way to go about getting this info loaded into a
> database? Should I created the table and fields first and then put all
> of the info in a yaml file and seed the database (I might have some
> questions on how to do that)? New xml files are getting dumped to these
> folders all the time, so I'm looking for a nice way to get this info
> into the database without too much hassle.

Then you don't want to seed the database -- seeding is only for 
relatively static data (such as state and country names) that needs to 
be loaded before you ever run the application.  It sounds to me like you 
simply want to read the XML files and build INSERT queries.  And unless 
I'm badly mistaken, you already know how to do that.

You may need a cron job or some such to parse new files as they come in.

>
> I'm not sure how to make this data available to rails.

What's the problem, exactly?  There's nothing here that you don't know.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to