Friday, January 14, 2011

How to import data from CSV text file

Sample data:

https://docs.google.com/uc?id=0B1MUVvZdMiWpMDZkMTk1ZjYtZTQ4ZS00YjE3LTg5YTEtNjhmZjZjYWZjNTUz&export=download&hl=en


Instruction:

A CSV file is a specially formatted plain text file, which stores spreadsheet or basic database-style information in a very simple format, with one record on each line, and each field within that record separated by a comma.

Most PC based spreadsheet program can create CSV file and we will use Microsoft Excel for this example.

Step 1) Excel

Go to Excel and open a spreadsheet.


Step 2) Header

Create header line in the first row with the titles of each column. Available column titles are as follows.


Front
Back
Note
Image

Please make sure to use only the given titles listed above. If a column is not properly titled, all the values in the column will be ignored.



Step 3) Rows

Enter the cards from the second row.


In Flashcards Buddy, a card has three sides, (1) Front side, (2) Back side and (3) Note section. Each row will become one card and Texts in each columns are imported to front side, back side and note section.

If there is a card with image, (1) copy the image file in "/FlashcardsBuddyPro/image" folder in SD card and (2) add the name of the image file in "Image" column. Then, Flashcards Buddy will attach the image in back side of the card.

Step 4) Save

Save the spreadsheet.


When saving file, make sure to save the spreadsheet as "csv" type. For this, use the "CSV (Comma delimited) (*.csv)" option in "Save as Type". Flashcards Buddy cannot understand the default "xls" type.


Step 5) SD card

Now, you are done with Excel. Copy the file to SD card and go to Flashcards Buddy


Step 6) Go to Card set


"Import" button is located in Card set screen. The cards will be imported into the currently selected card set.


Step 7) Start Import

In import screen, you will see the list of folders and files in SD card. Folders have yellow folder icon in left, and CSV files has white import icon in right side.


Press the csv file you just created in Excel. Then you will see the list of rows you have created.


Extra) Language encoding problem

If your csv file includes non-English characters such as Asian two-byte character, you will have display problem.

This problem is mostly caused by the language-encoding difference between Windows Excel and Android OS. If you are familiar with encoding, you may solve the problem using third party notepad application such as NotePad++ or EditPlus. These programs can convert "ASCII" in Excel CSV to "UTF-8" which is used by android OS. Otherwise, we recommend "Import from Google Docs" option instead of CSV import.