Re: moving data from text file to db

2002-03-06 Thread Jon Molin
tom poe wrote: Hi: I have a script that connects to my PostgreSQL7.0.3 OK. Now, I also have text files that contain: column_name: data I want to open the database, open the file, read each line that has a column_name followed by a colon and space, then the data, and move it to the

Re: moving data from text file to db

2002-03-06 Thread tom poe
On Wednesday 06 March 2002 00:34, Jon Molin wrote: - - - snip - - - something like this maybe: open (DATAFILE, 'somefile'); while (DATAFILE) { my @values = split /: /, $_; my $sql = insert into $values[0] ... $dbh-do ($sql); } /Jon - - - snip - - - Hi, Jon: Thanks. That

moving data from text file to db

2002-03-05 Thread tom poe
Hi: I have a script that connects to my PostgreSQL7.0.3 OK. Now, I also have text files that contain: column_name: data I want to open the database, open the file, read each line that has a column_name followed by a colon and space, then the data, and move it to the table in PostgreSQL. Has