By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,077 Members | 2,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,077 IT Pros & Developers. It's quick & easy.

text files

P: n/a
Im doing perl for an online store and wondering if someone knew a way (a
script) to get my text files in to my database?
Jul 20 '05 #1
Share this Question
Share on Google+
15 Replies


P: n/a
Ethan wrote:
Im doing perl for an online store and wondering if someone knew a way (a
script) to get my text files in to my database?


If you can get your text files into sql-dump-format, then it should be easy.

So you should have the database ready, and tables created and then file
that has rows for example like this:

insert into yourtablename values(1,2,'some text' );
insert into yourtablename values(2,2,'some other text' );
insert into yourtablename values(3,2,'some other text' );

The values part of course change according to your table structure.

Then if you have this in a file called dump.sql you can get it into
mysql using mysql console program:

mysql -u root databasename < dump.sql
Jul 20 '05 #2

P: n/a
Ethan wrote:
Im doing perl for an online store and wondering if someone knew a way (a
script) to get my text files in to my database?


If you can get your text files into sql-dump-format, then it should be easy.

So you should have the database ready, and tables created and then file
that has rows for example like this:

insert into yourtablename values(1,2,'some text' );
insert into yourtablename values(2,2,'some other text' );
insert into yourtablename values(3,2,'some other text' );

The values part of course change according to your table structure.

Then if you have this in a file called dump.sql you can get it into
mysql using mysql console program:

mysql -u root databasename < dump.sql
Jul 20 '05 #3

P: n/a
Ethan wrote:
Im doing perl for an online store and wondering if someone knew a way (a
script) to get my text files in to my database?


If you can get your text files into sql-dump-format, then it should be easy.

So you should have the database ready, and tables created and then file
that has rows for example like this:

insert into yourtablename values(1,2,'some text' );
insert into yourtablename values(2,2,'some other text' );
insert into yourtablename values(3,2,'some other text' );

The values part of course change according to your table structure.

Then if you have this in a file called dump.sql you can get it into
mysql using mysql console program:

mysql -u root databasename < dump.sql
Jul 20 '05 #4

P: n/a
E
Im basically building a mock online dvd site for school
well my text file looks something like this:

IMAGE_NAME: action_2
TITLE: The Lord of the Rings: The Fellowship of the Ring
ACTOR: John Rhys-Davies - Gimli
Marton Csokas - Celeborn
Lawrence Makoare - Lurtz
Billy Boyd - Pippin
Liv Tyler - Arwen
Dominic Monaghan - Meriadoc Brandybuck
Hugo Weaving - Elrond
Ian Holm - Bilbo Baggins
Elijah Wood - Frodo Baggins
Peter Corrigan - Otho [Extended Version]
Sean Bean - Boromir
Sean Astin - Samwise Gamgee
Craig Parker - Haldir
Cate Blanchett - Galadriel
Andy Serkis - Gollum
Viggo Mortensen - Aragorn
Orlando Bloom - Legolas
Ian McKellen - Gandalf
Christopher Lee - Saruman
DIRECTOR: Peter Jackson
RATING: PG-13
NUMBER of DVDs: 4
LENGTH: 165 minutes
GENRE: ACTION
RELEASE DATE: 11/12/2002
ID: 2

so how do i get all of the actors in with the one dvd and everything else? i
need to a way to fill in the tables with this info
"Aggro" <sp**********@yahoo.com> wrote in message
news:AU***************@read3.inet.fi...
Ethan wrote:
Im doing perl for an online store and wondering if someone knew a way (a
script) to get my text files in to my database?
If you can get your text files into sql-dump-format, then it should be

easy.
So you should have the database ready, and tables created and then file
that has rows for example like this:

insert into yourtablename values(1,2,'some text' );
insert into yourtablename values(2,2,'some other text' );
insert into yourtablename values(3,2,'some other text' );

The values part of course change according to your table structure.

Then if you have this in a file called dump.sql you can get it into
mysql using mysql console program:

mysql -u root databasename < dump.sql

Jul 20 '05 #5

P: n/a
E
Im basically building a mock online dvd site for school
well my text file looks something like this:

IMAGE_NAME: action_2
TITLE: The Lord of the Rings: The Fellowship of the Ring
ACTOR: John Rhys-Davies - Gimli
Marton Csokas - Celeborn
Lawrence Makoare - Lurtz
Billy Boyd - Pippin
Liv Tyler - Arwen
Dominic Monaghan - Meriadoc Brandybuck
Hugo Weaving - Elrond
Ian Holm - Bilbo Baggins
Elijah Wood - Frodo Baggins
Peter Corrigan - Otho [Extended Version]
Sean Bean - Boromir
Sean Astin - Samwise Gamgee
Craig Parker - Haldir
Cate Blanchett - Galadriel
Andy Serkis - Gollum
Viggo Mortensen - Aragorn
Orlando Bloom - Legolas
Ian McKellen - Gandalf
Christopher Lee - Saruman
DIRECTOR: Peter Jackson
RATING: PG-13
NUMBER of DVDs: 4
LENGTH: 165 minutes
GENRE: ACTION
RELEASE DATE: 11/12/2002
ID: 2

so how do i get all of the actors in with the one dvd and everything else? i
need to a way to fill in the tables with this info
"Aggro" <sp**********@yahoo.com> wrote in message
news:AU***************@read3.inet.fi...
Ethan wrote:
Im doing perl for an online store and wondering if someone knew a way (a
script) to get my text files in to my database?
If you can get your text files into sql-dump-format, then it should be

easy.
So you should have the database ready, and tables created and then file
that has rows for example like this:

insert into yourtablename values(1,2,'some text' );
insert into yourtablename values(2,2,'some other text' );
insert into yourtablename values(3,2,'some other text' );

The values part of course change according to your table structure.

Then if you have this in a file called dump.sql you can get it into
mysql using mysql console program:

mysql -u root databasename < dump.sql

Jul 20 '05 #6

P: n/a
E
Im basically building a mock online dvd site for school
well my text file looks something like this:

IMAGE_NAME: action_2
TITLE: The Lord of the Rings: The Fellowship of the Ring
ACTOR: John Rhys-Davies - Gimli
Marton Csokas - Celeborn
Lawrence Makoare - Lurtz
Billy Boyd - Pippin
Liv Tyler - Arwen
Dominic Monaghan - Meriadoc Brandybuck
Hugo Weaving - Elrond
Ian Holm - Bilbo Baggins
Elijah Wood - Frodo Baggins
Peter Corrigan - Otho [Extended Version]
Sean Bean - Boromir
Sean Astin - Samwise Gamgee
Craig Parker - Haldir
Cate Blanchett - Galadriel
Andy Serkis - Gollum
Viggo Mortensen - Aragorn
Orlando Bloom - Legolas
Ian McKellen - Gandalf
Christopher Lee - Saruman
DIRECTOR: Peter Jackson
RATING: PG-13
NUMBER of DVDs: 4
LENGTH: 165 minutes
GENRE: ACTION
RELEASE DATE: 11/12/2002
ID: 2

so how do i get all of the actors in with the one dvd and everything else? i
need to a way to fill in the tables with this info
"Aggro" <sp**********@yahoo.com> wrote in message
news:AU***************@read3.inet.fi...
Ethan wrote:
Im doing perl for an online store and wondering if someone knew a way (a
script) to get my text files in to my database?
If you can get your text files into sql-dump-format, then it should be

easy.
So you should have the database ready, and tables created and then file
that has rows for example like this:

insert into yourtablename values(1,2,'some text' );
insert into yourtablename values(2,2,'some other text' );
insert into yourtablename values(3,2,'some other text' );

The values part of course change according to your table structure.

Then if you have this in a file called dump.sql you can get it into
mysql using mysql console program:

mysql -u root databasename < dump.sql

Jul 20 '05 #7

P: n/a
E wrote:
how do i get all of the actors in with the one dvd and everything else? i
need to a way to fill in the tables with this info


Can't you just parse your file and create a new one which is in the
sql-dump-format? You could do this with any programming language that
allows you to read and write files.
Jul 20 '05 #8

P: n/a
E wrote:
how do i get all of the actors in with the one dvd and everything else? i
need to a way to fill in the tables with this info


Can't you just parse your file and create a new one which is in the
sql-dump-format? You could do this with any programming language that
allows you to read and write files.
Jul 20 '05 #9

P: n/a
E wrote:
how do i get all of the actors in with the one dvd and everything else? i
need to a way to fill in the tables with this info


Can't you just parse your file and create a new one which is in the
sql-dump-format? You could do this with any programming language that
allows you to read and write files.
Jul 20 '05 #10

P: n/a
E
im new to this do you know how to do it in perl?
"Aggro" <sp**********@yahoo.com> wrote in message
news:kk***************@read3.inet.fi...
E wrote:
how do i get all of the actors in with the one dvd and everything else? i need to a way to fill in the tables with this info


Can't you just parse your file and create a new one which is in the
sql-dump-format? You could do this with any programming language that
allows you to read and write files.

Jul 20 '05 #11

P: n/a
E
im new to this do you know how to do it in perl?
"Aggro" <sp**********@yahoo.com> wrote in message
news:kk***************@read3.inet.fi...
E wrote:
how do i get all of the actors in with the one dvd and everything else? i need to a way to fill in the tables with this info


Can't you just parse your file and create a new one which is in the
sql-dump-format? You could do this with any programming language that
allows you to read and write files.

Jul 20 '05 #12

P: n/a
E
im new to this do you know how to do it in perl?
"Aggro" <sp**********@yahoo.com> wrote in message
news:kk***************@read3.inet.fi...
E wrote:
how do i get all of the actors in with the one dvd and everything else? i need to a way to fill in the tables with this info


Can't you just parse your file and create a new one which is in the
sql-dump-format? You could do this with any programming language that
allows you to read and write files.

Jul 20 '05 #13

P: n/a
E wrote:
im new to this do you know how to do it in perl?


No I don't, sorry. And I'm pretty sure that you won't find such a person
in this group that knows how to do it. But I am also sure that there are
some perl-related newsgroups out there where are people that know how to
do it with perl.
Jul 20 '05 #14

P: n/a
E wrote:
im new to this do you know how to do it in perl?


No I don't, sorry. And I'm pretty sure that you won't find such a person
in this group that knows how to do it. But I am also sure that there are
some perl-related newsgroups out there where are people that know how to
do it with perl.
Jul 20 '05 #15

P: n/a
E wrote:
im new to this do you know how to do it in perl?


No I don't, sorry. And I'm pretty sure that you won't find such a person
in this group that knows how to do it. But I am also sure that there are
some perl-related newsgroups out there where are people that know how to
do it with perl.
Jul 20 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.