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

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

[Octave-bug-tracker] [bug #54661] textscan() continues from next line if


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #54661] textscan() continues from next line if line ends with delimiter
Date: Fri, 14 Sep 2018 16:55:18 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0 SeaMonkey/2.48

Update of bug #54661 (project octave):

              Item Group:                    None => Incorrect Result       
                  Status:                    None => Confirmed              
                 Release:                   4.4.1 => dev                    

    _______________________________________________________

Follow-up Comment #1:

Confirmed.
I think this may well be a duplicate of bug #52867, or is related to it. That
said, the old strread.m has this same bug here but worked for bug #52867.

It is the EOL that somehow confuses textscan.
A way to read your data is to change the EOLs into a delimiter first:

>> f_in = fopen('bug_example.txt');
>> txt  = fread (f_in, Inf, "*char")';
>> fclose(f_in);
>> txt2 = strrep (txt, "\n", ",");
>> values = textscan(txt2, '%f %f %f %f', 'Delimiter', ',')
values =
{
  [1,1] =
      1
      5
      9
     13
  [1,2] =
      2
      6
     10
     14
  [1,3] =
       3
       7
     NaN
      15
  [1,4] =
       4
       8
     NaN
      16
}



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?54661>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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