473,320 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

text files

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
15 1767
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: Eric | last post by:
Assume that disk space is not an issue (the files will be small < 5k in general for the purpose of storing preferences) Assume that transportation to another OS may never occur. Are there...
0
by: Steve | last post by:
My application uses transfertext to create text files that are FTPed to a website and are processed by a webstore. The text files can be for one of three purposes: Add one or more items to the...
16
by: thenightfly | last post by:
Ok, I know all about how binary numbers translate into text characters. My question is what exactly IS a text character? Is it a bitmap?
0
by: richardkreidl | last post by:
I have the following hash script that I use to compare two text files. 'Class Public Class FileComparison Public Class FileComparisonException Public Enum ExceptionType U 'Unknown A 'Add...
3
by: Frustrated Developer via DotNetMonster.com | last post by:
I have posted a couple times on here already and found the user community to be very helpful. I took on a project before I realized how difficult a time I'm having working with a database....
10
by: joelagnel | last post by:
hi friends, i've been having this confusion for about a year, i want to know the exact difference between text and binary files. using the fwrite function in c, i wrote 2 bytes of integers in...
5
by: praveenholal | last post by:
Hi Freinds , I want to convert the files that are in text format (.txt) to CSV file. I am working on Linux. So can anyone guide me. Here is my problem Description I have some result files...
29
by: list | last post by:
Hi folks, I am new to Googlegroups. I asked my questions at other forums, since now. I have an important question: I have to check files if they are binary(.bmp, .avi, .jpg) or text(.txt,...
1
by: Xah Lee | last post by:
Text Processing with Emacs Lisp Xah Lee, 2007-10-29 This page gives a outline of how to use emacs lisp to do text processing, using a specific real-world problem as example. If you don't know...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.