473,322 Members | 1,493 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,322 software developers and data experts.

Importing multiple files

Hi,
I have to import hundreds of file to MySQL database. Is it
possible to write a script/storedprocedure in MySQL that does this
without manually doing it for each file.
Say file names are of type 'file0001.txt', 'file0002.txt' etc. Does
MySQL provide any such utility or does anyone know of a free utility?.
If not then what is best language to write such a script/program. Cant
such a script be written in PHP easily?

Thx.
Dec 9 '07 #1
4 1346
NC
On Dec 8, 9:53 pm, myGoogle71 <ali...@sunnipath.comwrote:
>
I have to import hundreds of file to MySQL database.
....
Say file names are of type 'file0001.txt', 'file0002.txt' etc.
....
Cant such a script be written in PHP easily?
Yes.

Cheers,
NC
Dec 9 '07 #2
On Sun, 09 Dec 2007 06:53:29 +0100, myGoogle71 <al****@sunnipath.com>
wrote:
Hi,
I have to import hundreds of file to MySQL database. Is it
possible to write a script/storedprocedure in MySQL that does this
without manually doing it for each file.
Say file names are of type 'file0001.txt', 'file0002.txt' etc. Does
MySQL provide any such utility or does anyone know of a free utility?.
If not then what is best language to write such a script/program. Cant
such a script be written in PHP easily?
Easily written. Check the glob() function in PHP & de LOAD_FILE() function
in MySQL.
--
Rik Wasmus
Dec 9 '07 #3
myGoogle71 wrote:
Hi,
I have to import hundreds of file to MySQL database. Is it
possible to write a script/storedprocedure in MySQL that does this
without manually doing it for each file.
Say file names are of type 'file0001.txt', 'file0002.txt' etc. Does
MySQL provide any such utility or does anyone know of a free utility?.
If not then what is best language to write such a script/program. Cant
such a script be written in PHP easily?

Thx.
As Rik indicated, this is very easily done in PHP. But if you're
looking how to do it in MySQL, you're in the wrong group - you want
comp.databases.mysql.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Dec 9 '07 #4
Jerry Stuckle wrote:
myGoogle71 wrote:
>Hi,
I have to import hundreds of file to MySQL database. Is it
possible to write a script/storedprocedure in MySQL that does this
without manually doing it for each file.
Say file names are of type 'file0001.txt', 'file0002.txt' etc. Does
MySQL provide any such utility or does anyone know of a free utility?.
If not then what is best language to write such a script/program. Cant
such a script be written in PHP easily?

Thx.

As Rik indicated, this is very easily done in PHP. But if you're
looking how to do it in MySQL, you're in the wrong group - you want
comp.databases.mysql.
Oops - I didn't look for a crosspost :-(. My bad.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Dec 9 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: steve | last post by:
Hi, I have researched but have not found a good solution to this problem. I am importing large amounts of data (over 50 Meg) into a new mysql db that I set up. I use >mysql dbname <...
4
by: Indra | last post by:
Hi There, I am looking for information on how to import the txt or csv file to the multiple table in sql 2000. If you have any kind of inf. please let me know wheather we can do this and how. ...
1
by: Steve George | last post by:
Hi, I have a scenario where I have a master schema that defines a number of complex and simple types. I then have a number of other schemas (with different namespaces) where I would like to reuse...
2
by: Regnab | last post by:
Just chasing a few ideas for a suitable loop for importing multiple text files. Up until now I have used a Do While Len(strfile) > 0 and moved each file to a different folder after being imported....
5
by: Mike Collins | last post by:
I am trying to export data from multiple tables in SQL Server to an XML file so I can then import it to another database. It seems to be working fine for exporting, but I am having trouble...
3
by: mukeshsrivastav | last post by:
dear sir i want to move form excel to access. i have 5 excel file having same formats and fields.now i want to import all data in one access table. importing one file is easy .but importing and...
4
by: JamesSykes | last post by:
Hi, I am relatively new to Access and VBA. I am trying to import a number of database files (just really want the contents of their tables) from a specified folder into a master table that...
28
by: kkadakia | last post by:
I get a daily excel file for a entire month which I want to transfer into Access at the end of the month. So, there are around 20-25 excel files I get by the end of the month, and I would like to...
7
by: cannunzi | last post by:
I'm trying to import multiple files in one access table all at once but i keep hitting an error stating incorrect file path. The code below works when i change the * to the exact file name but then...
2
by: ciaran.hudson | last post by:
Hi I have multiple excel files of the same format in a directory. They are called book1.xls, book2.xls, book3.xls and so on. What is the easiest way to import the tab named sheet1 from each of...
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.