octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #52867] textscan produces an incorrect cell ar


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #52867] textscan produces an incorrect cell array
Date: Mon, 15 Jan 2018 09:27:13 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0

Follow-up Comment #7, bug #52867 (project octave):

@Pedro:
A workaround is the following code that works for me to read your file:

## Open & read file
fid = fopen ("cruise_params.cfg.tmp");
txt = fread (fid, Inf, "char=>char")';
fclose (fid);
## Split file on line endings and remove comment lines
txt = strsplit (txt, "\r\n")';
txt = txt(find (cellfun (@isempty, strfind (txt, "#"))));
## Concatenate strings + apply textscan
txta = strjoin (txt, "\n");
C = textscan (txta, "%s%s", "delimiter", {"=", "\n"});



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52867>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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