GreaseMunky User Guide

Importing Comma Separated Value Files

Comma Separated Value (CSV) files are simple text files commonly supported by spreadsheet programs like Apple's Numbers and Microsoft Excel. The simplicity of this file format makes it a convenient way for programs to export and import tabular data. GreaseMunky is capable of exporting CSV files as discussed in the section on emailing reports, and as you will see, they can be imported as well.

NOTE: This features requires iOS 4, previous iOS versions do not support this feature.

CSV File Format

A comma separated value table is, as the name implies, a simple textual representation of a table where the values in the columns are separated by commas, and the rows of the tables are separated by new lines. Following is an example of what a CSV file might contain:

Date,Odometer,Cost,Gallons,Notes
11/17/10 11:26 AM,104835.0,$44.39,"14.889",""
11/26/10 4:45 PM,105296.0,$49.02,"17.769",""
12/3/10 11:50 AM,105700.0,$50.14,"17.060",""
12/7/10 10:35 AM,106089.0,$49.58,"16.729",""
12/12/10 2:50 PM,106427.0,$46.38,"16.646",""
12/18/10 2:50 PM,106843.0,$50.66,"17.063",""
12/19/10 12:26 PM,107177.0,$39.74,"13.707",""
12/19/10 2:50 PM,107605.0,$0.00,".000",""
12/23/10 2:50 PM,107605.0,$51.43,"16.959",""

CSV files vary a bit, but for the most part, they are all very similar. The first row of the file contains the names of the associated column data. This first row is required by GreaseMunky. We can see that this file contains 5 columns named "Date", "Odometer", "Cost", "Gallons" and "Notes". Commas are used to separate the column data both in the header row with the column names, and in the data rows. Some CSV files use a different character to separate columns, but GreaseMunky requires commas to separate columns. In some cases, the actual data in a column may contain a comma, so you can quote the contents of a column so all commas within the quotes will be interpreted as part of the data.

Importing CSV files can be rather tricky, there are a huge variety of formats in which data like dates and currency might be represented. GreaseMunky does its best to support a wide variety of formats, but there is no guarantee it will be able to import a particular file. Developers focused on ease of use to make a wide variety formats accessible, but no data is actually imported till the user selects the new data record for inclusion.

Preparing a CSV File

In some cases, a CSV file will contain more than one table, or additional supplimental data beyond the actual content of the table. GreaseMunky does not know how to deal with such data, so these additional rows of the table will need to be removed. Each row of the table should contain the same number of comma separated column values. These files are simple text file, so most any editor can be used to modify them, but make sure when you save the file, you save it as plain text.

Let's walk through the following example:

Volkswagen, Jetta, TDI, 140000
Date,Odometer,Cost,Gallons,Notes
11/17/10 11:26 AM,104835.0,$44.39,"14.889",""
11/26/10 4:45 PM,105296.0,$49.02,"17.769",""
12/3/10 11:50 AM,105700.0,$50.14,"17.060",""
12/7/10 10:35 AM,106089.0,$49.58,"16.729",""
12/12/10 2:50 PM,106427.0,$46.38,"16.646",""

The first row contains information about vehicle the associated records reference. Although useful information, GreaseMunky does will not know how to deal with this data, so it should be removed before the CSV files before it is installed on the iPhone. Use your favorite text editor to do this, but make sure you save the file as plain text, and use the ".csv" suffix. After removal of the associated data, the file will look like this:

Date,Odometer,Cost,Gallons,Notes
11/17/10 11:26 AM,104835.0,$44.39,"14.889",""
11/26/10 4:45 PM,105296.0,$49.02,"17.769",""
12/3/10 11:50 AM,105700.0,$50.14,"17.060",""
12/7/10 10:35 AM,106089.0,$49.58,"16.729",""
12/12/10 2:50 PM,106427.0,$46.38,"16.646",""

With the first

line removed, the file is now ready to install on the iPhone into the GreaseMunky application.