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

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

[Octave-bug-tracker] [bug #50813] importdata returns cell-of-strings ins


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #50813] importdata returns cell-of-strings instead of struct
Date: Tue, 18 Apr 2017 15:46:07 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46

Update of bug #50813 (project octave):

                  Status:               Need Info => Confirmed              
                 Release:                   4.2.1 => dev                    

    _______________________________________________________

Follow-up Comment #7:

@OP:
You can at least recover the numeric data using:

AData = importdata('Plot5G.txt', ' ')


i.e., specify the delimiter explicitly.

A quick analysis shows that the regexp in L.174 (in subfunc importdata_asci)
turns up "g" rather than a space as delimiter.
But even when specifying the delimiter explicitly the header isn't parsed
correctly, so there's a bug I think.
That Matlab seems a bit smarter than Octave as regards parsing the header is a
mere compatibility issue.

Once you got the data read fine, the header entries can be parsed using some
magic provided you know what the header is expected to look like. In this
specific case:

>> strtrim (cell2mat (regexpi (A.textdata{1}, '([a-z() \.\[]+?\])',
"tokens")))
        ans = {
          [1,1] = Theta [deg.]
          [1,2] = Phi   [deg.]
          [1,3] = Abs(Grlz)[dB    ]
          [1,4] = Abs(Cross)[dB    ]
          [1,5] = Phase(Cross)[deg.]
          [1,6] = Abs(Copol)[dB    ]
          [1,7] = Phase(Copol)[deg.]
          [1,8] = Ax.Ratio[dB    ]
        }
>>


I also leave this open as I have other priorities the next weeks.

Status => confirmed
Release => dev


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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