Path: news.mathworks.com!not-for-mail
From: "Ryan Utz" <rutz@al.umces.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Omitting certain lines with 'textscan'
Date: Sun, 23 Nov 2008 19:32:01 +0000 (UTC)
Organization: University of Maryland
Lines: 11
Message-ID: <ggcb3h$k5k$1@fred.mathworks.com>
Reply-To: "Ryan Utz" <rutz@al.umces.edu>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227468721 20660 172.30.248.38 (23 Nov 2008 19:32:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 23 Nov 2008 19:32:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1502608
Xref: news.mathworks.com comp.soft-sys.matlab:502666


Hi all,

I'm trying to import a very basic data set that looks like this:

year month day hour flow
1992 2 13 6 18.3

Sometimes, however, when the data are erroneous the final field (flow) is listed as a negative number. I'd like to just omit any and all data when this is the case, in other words, I don't even want the dates for erroneous data to be imported. Is there a clean way in 'textscan' to specify when to ignore a particular line when it involves just one field? If not, anyone have any post-import ideas?

Thanks,
Ryan