[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: textread error handling

From: Fritz Sonnichsen
Subject: Re: textread error handling
Date: Fri, 2 Nov 2018 13:03:43 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

  at your suggestion,  I converted from textread to textscan and the dataset if loaded just fine. So I am not sure why textread keeps failing-at any rate I am content to use textscan going forward.  Thanks for your suggestion

On 11/1/2018 2:30 PM, Ian McCallion wrote:
Just a thought, does textscan leave the opened file positioned at the start of the glitch?

If so at least you can see the erroneous data using a different file function, eg fileread.

Cheers... Ian
On 1 Nov 2018, at 18:51, Fritz Sonnichsen <address@hidden> wrote:
This happens a lot--I read in a large (200,000 lines) file generated 
from a serial port and a few records are "glitched".  textread aborts 
producing messages like:

warning: strread: unable to parse text or file with given format string
warning: called from
     strread at line 713 column 7
     textread at line 249 column 31
     drift at line 9 column 40
error: some elements undefined in return list
error: called from
     textread at line 249 column 31
     drift at line 9 column 40

I want textread to handle the error and continue. I can deal with 
corrupted data in the returned arrays from there. Of worse case, I would 
at least like textread to report which record it stopped on so I can 
look into it.

I didn't see an option for this in the doc. Did I miss it?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]