How to convert on the fly a .txt to a MYSQL database


I need to use data from a RS232 serial data logger that saves on a .txt and convert this to  a local MYSQL database on the fly.

Any ideas?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If you mean you have data that is comma or otherwise delimited and want to import it to mysql, here's info on the mysql query to run LOAD DATA INFILE

Example: LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table;

If you mean you have no database and it should create one, you'd need to issue a
then a lot of others for that to happen. This could be done from a script or batch file or a program that you write.
Tomas Helgi JohannssonCommented:

MariaDB a fork of MySQL has a storage engine called Connect which can easily connect to csv or some other file types (see ) and that way you can
add new files as tables to a MariaDB database on the fly using scripts as the files get created.

    Tomas Helgi

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hi , MariaDB works for a PDF report format but i needs to use a RS232 software logger to send data from a LAB machine to a MYSQL database.

Tomas Helgi JohannssonCommented:

The Connect Storage Engine takes a wide range of files including files that a RS232 loggers produce and transforms the data into relational table.

You could even use the BIN table format directly on a RS232 file if you analyse and/or know the binary stream that is put into the file.

    Tomas Helgi
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.