In Progress

PHP Script To Convert Multiple CSV files in Bulk to SQL Insert Commands

I need a PHP script that can convert multiple CSV files stored in a server folder into MYSQL compatible SQL insert commands which first truncate the destination tables, then execute data insertion. I need the columns to be inserted into SPECIFIC database columns, which are defined by the CSV headers (1st row). The tables are defined by the actual file name. The CSV files will not always perfectly match the destination table. This is crucial to understand! The PHP file should auto detect a new set of CSV files in the folder and execute on its own.

EXAMPLE:

[url removed, login to view] ---->>>>> Auto detect and transform to:

TRUNCATE TABLE `action-keys`;

INSERT INTO `action-keys`

(`_ID`,`_IDfile-segments`,`action-key`,`action-keys`,`case-file`)

VALUES('1','1','00',' ','');

INSERT INTO `action-keys`

(`_ID`,`_IDfile-segments`,`action-key`,`action-keys`,`case-file`)

VALUES('1','45','00',' ','');

INSERT INTO `action-keys`

(`_ID`,`_IDfile-segments`,`action-key`,`action-keys`,`case-file`)

VALUES('1','100','00',' ','');

It must be very EXPLICIT table & column insertion for every row in every CSV file. If you can streamline the SQL more and still make this work as outlined, I'm fine with that.

Samples CSV files are attached to this project.

Skills: MySQL, PHP, Software Architecture

See more: convert multiple rss feeds csv format, access exit status sql files python script, vbscript sql insert csv, sql 2005 express sql insert csv file, csv sql insert, sql server asp export csv script, aspnet csv files prcessed script, insert xml files tables sql server, insert xml files sql server, sql insert csv file

About the Employer:
( 4 reviews ) Salt Lake City, United States

Project ID: #8791823

Awarded to:

bestphpjobs

I read your project description and that make sense , at there you described issue very well. I know all stuff good that you want for this job, PHP, javascript, mysql, html, etc very well. I can manage this job very we More

$55 USD in 2 days
(142 Reviews)
6.2

11 freelancers are bidding on average $56 for this job

rajeshsonisl

Hello! With 98% to 99% completion rate, 850+ successfully completed projects, and a 5.00 reputation (maximum possible, 5.0) (Yes, not even 4.99 average rating, can be verified on my profile page [url removed, login to view] More

$210 USD in 1 day
(660 Reviews)
7.8
gangabass

I can create such program in less than a day and I can offer you best price here. Please show me more files and your database schema. Thanks. Roman

$55 USD in 1 day
(191 Reviews)
6.3
noxtras

Hi, What do you mean that the CSV does not always match the table? Does it have more columns, fewer? So you need to always truncate (Empty ) the tables before inserting?

$30 USD in 1 day
(69 Reviews)
6.0
isensebd

A proposal has not yet been provided

$100 USD in 3 days
(64 Reviews)
5.5
shengui

Hi, I read the description and knew what you need. It's my work. I can complete this job with clear results. because i have done many similar jobs with good feedback. best regards thanks

$33 USD in 0 days
(32 Reviews)
5.2
jonaslangseth

Hello I have long experience of extracting and inserting data from an to various sources. I am available to start working immediately if you are interested in hiring me for this project. Best regards, Jonas

$35 USD in 2 days
(4 Reviews)
2.5
netsolwp

A proposal has not yet been provided

$30 USD in 1 day
(1 Review)
1.4
atryom

Hello. I can do what you want, I have much experience in php. And I think I can accomplish your task quickly enough. I can perform the task at the server. We can see the result in the form of a file that you send me. I More

$30 USD in 2 days
(1 Review)
0.4
DMGflasher

I can write a php code for csv upload , at the first the table will be empty by sql query , and then ignore the 1st row for insert . this row have column name same as database filed name , i will check name with da More

$30 USD in 1 day
(0 Reviews)
0.0
jdcmoore

I look forward to you choosing me for this job.

$20 USD in 1 day
(1 Review)
0.0
bl4ckraven

i can do this today before accept i wish understand better 2 point: 1) how "The CSV files will not always perfectly match the destination table" can you give me an example of mismatching? 2)you want output on txt More

$20 USD in 0 days
(0 Reviews)
0.0