views:

31

answers:

2

i am planning to get some Data Entry done for the records of Restaurant info which i later want to upload to MySQL table.

Is there some kinda rules i need to follow because i read some place that we have to mention some kinda delimiter like , ; etc. not sure how to do that in Excel.

Secondly can i use Google Forms which stores question into Google sheets for doing the same as filling the form will be a lot faster and typing it out in excel :D

+2  A: 

You can save the file (in Excel and also in Google spreadsheet) as a CSV. You can load the CSV into mysql using the LOAD DATA INFILE syntax. For example:

LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table
FIELDS TERMINATED BY ',' ENCLOSED BY '' ESCAPED BY '\\'
LINES TERMINATED BY '\n' STARTING BY ''

http://dev.mysql.com/doc/refman/5.1/en/load-data.html

OmerGertel
the normal saving of a file is not the comma seperated variable kind ?
Harsha M V
No. Excel's default is XLS and Google is on the cloud (no file by default). But it's supported in both (file->save or file->download respectively).
OmerGertel
oh ok. thanks a lot. so i can just use google forms and then export as CSV and then use the above code. just wondering is there a way to make html forms to write a CSV file too ? bcos i will be outsourcing the work. wanna make sure i give it the right way.
Harsha M V
OmerGertel
thanks a lot.... mate :D
Harsha M V
+1  A: 

Excel is the enemy of database programmers. If you simply ask someone to fill in an Excel spreadsheet expect 1) data in the wrong column for some rows, 2) text in fields that must be numbers (eg "bet 10 and 20", 3) Incomplete date fields (eg "10/2010"), text that is too long to fit your column definition and other problems.

However, if you have clean data you can Save As CSV in Excel and that will produce a file that any tool that can read CSV will be able to parse and load.

Larry Lustig
whats the best way i can feed data into the db... taking into account i will have around 1500 rows.
Harsha M V