Parsing a file

Hi eveyone,

If I want to parse a string file when the user uploads afile, how can I
extract only those strings that i want, assuming that i already have the
ruby script? should I save the file temporaryly and parse it and then
export desired data or is there another way of parsing a file directly
into the database?

thanks