1

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

1
  • This appears to be very similiar to 8031193 Commented Dec 2, 2012 at 23:06

2 Answers 2

4

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

Sign up to request clarification or add additional context in comments.

4 Comments

the normal saving of a file is not the comma seperated variable kind ?
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).
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.
Google forms enters the data in a Google spreadsheet, I think. Also, Google Apps have a scripting language, which you can use to export the data as CSV automatically. Take a look here for a sample of creating a CSV and sending it by mail: google.com/support/forum/p/apps-script/…
2

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.

1 Comment

whats the best way i can feed data into the db... taking into account i will have around 1500 rows.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.