[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reading CSV data and preserving empty cells?
From: |
forkandwait |
Subject: |
Reading CSV data and preserving empty cells? |
Date: |
Mon, 29 Mar 2010 05:35:06 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Hi all,
Does anyone have any advice on reading csv files with a function that converts
empty data into NaN's.
dlmread converts missing columns into zeros, which is probably matlab
compatible but also pretty stupid (golly, is a missing data point the same
thing as a measurement of zero... duh...). textread would probably work, but
I don't want to write a format string for every dataset with 200+ columns.
Perhaps an awk script to pre-process, but that sounds gross.
csv2cell in octave-forge converts them into blank text -- this is approaching
reasonable, but how to do I mass-convert all the blanks into NaNs?
I think I will probably try to figure out a cellfun/ cellidx solution tomorrow,
but if anyone has done this before, please share your approaches.
Best!
- Reading CSV data and preserving empty cells?,
forkandwait <=