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

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

[Octave-bug-tracker] [bug #39505] dlmwrite with coffset and roffset >0,


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #39505] dlmwrite with coffset and roffset >0, inserts extra characters
Date: Wed, 17 Jul 2013 21:16:14 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0 SeaMonkey/2.17.1

Follow-up Comment #10, bug #39505 (project octave):

No I didn't read back in Octave, I just tried your original example in Octave
with double quotes around \t. That gave a beautiful text file with -seemingly-
empty lines - but read on.

Trying you original example in Matlab r2013b pre-release gives:


>>  a=[1 2 3 4 5;1 2 3 4 5;1 2 3 4 5];
>> dlmwrite('matrix_text.txt',a,'-append','on','delimiter',
'\t','roffset',0,'coffset',0)
Error using dlmwrite (line 113)
Invalid attribute tag: on


so your example doesn't work as-is in Matlab; 'append' is not a valid
user-configurable option in ML.

About your comment #4, did you literally try it in Matlab?
If I try (in ML r2013b pre-release):


dlmwrite('matrix_text2.txt',a,'delimiter',',','roffset',5,'coffset',0)
-verbatim

I get:


,,,,
,,,,
,,,,
,,,,
,,,,
1,2,3,4,5
1,2,3,4,5
1,2,3,4,5


so your claim that ML writes blank lines for empty data rows in case of
printable delimiters doesn't hold water. Not at all.
It does for tabs, but in a binary editor you'll see there are indeed tabs
inserted for empty data rows, only thing is you don't see tabs directly as
they are non-printable. In my comment #5 you do see them expressed as 8-space
jumps.

As to comment #7, I don't follow. dlmread probably reads zeros as it returns a
type double matrix, not a cell array. Read the docs about dlmread's behavior.
ML r2013b prr-release "help dlmread" says this literally (I assume I may quote
small excerpts, Jordi?):


dlmread fills empty delimited fields with zero.



All in all I see nothing wrong with writing / reading empty data rows. I do
think you've just misinterpreted the docs.
I tend to close this bug report with "invalid" but I'll await responses from
Rik or Jordi.

The "\t" versus '\t' is another issue. Is this documented? If not, it may be
worth another bug report.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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