This example has helped me imensely. I like how it explains one action and explains it well.
When I download the file and save it as a csv it works just perfect.
But when instead of downloading I open it it says, "The file you are trying to open CSV_Output.csv.xls...", with an xls extension. Maybe this is an Excel problem.
It works perfectly if I save it as a csv and then open it though.
Has anyone else noticed this problem?