[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #38711] dlmread add extra zero line when file
From: |
Alois Schlögl |
Subject: |
[Octave-bug-tracker] [bug #38711] dlmread add extra zero line when file contains "\0" at the end. |
Date: |
Thu, 11 Apr 2013 20:21:12 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.16) Gecko/20121207 Iceweasel/3.5.16 (like Firefox/3.5.16) |
URL:
<http://savannah.gnu.org/bugs/?38711>
Summary: dlmread add extra zero line when file contains "\0"
at the end.
Project: GNU Octave
Submitted by: schloegl
Submitted on: Do 11 Apr 2013 20:21:11 GMT
Category: Libraries
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 3.6.4
Operating System: GNU/Linux
_______________________________________________________
Details:
Some csv files generated by some other software, contained a "\0" before the
end of file. When trying to read this file, an extra row with zeros has been
added to the resulting matrix.
The attached patch shows the problem in the test/assert statement, and
provides a solution.
Other solutions than "if(!strlen(line.c_str()))" did not seem to be
successful. line.length() is 1, and line.empty() was zero. when the line "\0"
was read.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Do 11 Apr 2013 20:21:11 GMT Name:
dlmread-fix-for-0-terminated-file.patch Size: 745B By: schloegl
<http://savannah.gnu.org/bugs/download.php?file_id=27844>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?38711>
_______________________________________________
Nachricht gesendet von/durch Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #38711] dlmread add extra zero line when file contains "\0" at the end.,
Alois Schlögl <=