How to read CSV files

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 28 2010 - 10:41:06 MDT

We've had a number of people ask us how to read CSV (comma separated values) files, so I created a new examples page for this:

   http://www.ncl.ucar.edu/Applications/read_csv.shtml

CSV files are actually easier than most files to read, because you know your fields are all separated by commas. If any of
your fields actually contain commas, then the fields have to further be distinguished by enclosing them in quotes.

This page shows how to handle both kinds of files (using rather simplistic example datasets).

The asciiread, str_get_field, and str_sub_str functions are useful ones for reading CSV files.

I know a number of you have already written your own NCL scripts for handling CSV files. If you have one that you'd like to contribute,
send me the data and script and I'll add it to the page. It would nice to have some "real world" examples.

Cheers,

--Mary

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jul 28 10:41:13 2010

This archive was generated by hypermail 2.1.8 : Wed Jul 28 2010 - 10:42:06 MDT