Chapter

Fetch CSV Module

Fetch CSV Module

CSV stands for “comma separated value”. It’s basically a dumbed-down version of a database. You can make one in Microsoft Excel and other database programs. CSV is a very popular method used to process information in database form. Each field is separated by a comma, and each new line is a separate record. Do you have a Microsoft Excel file on your computer? We can convert that to CSV, upload it to Yahoo Pipes and mashup that data. It could be a list of contacts, next weeks menu plan, a list of stock quotes, phone numbers – basically anything. If you have an Excel file on your computer, you can resave it as a .csv file and upload it to Pipes to mash it up.

Here is our sample CSV file in Excel:

Fetch CSV Module

We’re then going to upload it to the web at:

http://chilliwackdesign.com/yahoopipes/fetchcsv2.csv

and then plug that URL into the Fetch CSV Module of Yahoo Pipes. By default, the Fetch CSV Module knows that the first row of our CSV file contains our data headers, so it leaves us with 3 results – which you can see in the debugger pane.

Fetch CSV Module

If we drill down the results, we can see our data has been split up. As you can see, it shows our Venue, Capacity, City and the row number that our data was on (Yahoo Pipes automatically inserts the row number). Because the information is split up in this fashion, it will allow us to take only the data we need and mash it up easily.

Fetch CSV Module

Yahoo Pipes wants you to enter the URL where the CSV file is hosted. (Hopefully you know the address of the CSV file, or have a web site of your own to upload your CSV files to). If not, I’d recommend taking a look at Google Docs to get you started. You can create and host your own CSV files there for free, which you’ll need to practice with.

Now that you’ve entered the location of your CSV file, Pipes wants to know how the file is delimited. Are the columns separated by a comma, semi-colon, vertical line ( “|” ), space, or tab? By default, and most of the time, you’ll want to select the comma ( “,” ). If none of those characters separate your data, you can enter a custom one.

Tip: It’s best to use commas or tabs to separate your data because they are the most commonly accepted delimiters.

Next, Yahoo Pipes wants to know if it should skip any rows of data. If you have data in your CSV file that you don’t want to include (ie a title on the first line), then you need to tell Pipes to skip that row. When I create my CSV files, I make sure there’s no unnecessary data just to keep things clean and simple.

Now Pipes wants to know what rows to use for the column headers. By default it selects rows 1 to 1 and that’s what you want. Just like most databases, you have your column headers on row 1, and then your data begins. If you don’t have column headers then enter 0 for both.

Now Pipes wants to know if it should rename the column headers of your CSV file. Maybe you have a column named “Contacts” and you want to rename it “Employees”. Here’s where you can change that. Enter a new name for the corresponding column.

Tip! I like to have my column names properly named before I upload my CSV file to Pipes. This makes it easier to maintain and all the info is one place.

0 Comments ↓

No comments yet.

Leave a Reply