plz anybody help me in uploading data from excel file to mysql database. data in excel sheet is in vertical format not horizontally. I mean to say that the columns of mysql tables are in rows in excel.
uploading excel file to mysql
Collapse
X
-
-
Hi.
I would personally prefer the following solution:
* Convert your rows to columns and vice-versa in the excel file. This may be done by selecting and copying all your data; click on Edit->Paste Special. Tick 'Transpose'. Paste the data in a new sheet so that you don't lose your data.
* Save the excel file as a 'Comma-separated values' text file (with extension .txt).
* load the file in mySQL using
Code:LOAD DATA INFILE 'test.txt' INTO TABLE aa FIELDS TERMINATED BY ',' lines terminated by '\n'
PrakashComment
-
vpmurdan: is there any reason why you would take such a (manually performed) detour to get the same results?
Ronald :cool:Comment
-
Originally posted by vpmurdanHi.
I would personally prefer the following solution:
* Convert your rows to columns and vice-versa in the excel file. This may be done by selecting and copying all your data; click on Edit->Paste Special. Tick 'Transpose'. Paste the data in a new sheet so that you don't lose your data.
* Save the excel file as a 'Comma-separated values' text file (with extension .txt).
* load the file in mySQL using
Code:LOAD DATA INFILE 'test.txt' INTO TABLE aa FIELDS TERMINATED BY ',' lines terminated by '\n'
Prakash
thanks. I do it, it is good for local server, as I save my csv files in the directory of mysql server where my database was created. But I have to do it for remote mysql server that is installed on remote linux machine. My database is already created there. How can I remotely save my csv files there.
error is:
'/var/lib/mysql/stdDB/test.csv' not foundComment
-
Originally posted by ronverdonkvpmurdan: is there any reason why you would take such a (manually performed) detour to get the same results?
Ronald :cool:
Hence the detour.Comment
Comment