bugGNU Octave - Bugs: bug #50297, csv2cell does not ignore CR in...


bug #50297: csv2cell does not ignore CR in CRLF files

Submitted by:  A.R. Burgers <arb>
Submitted on:  Mon 13 Feb 2017 07:02:24 PM UTC  
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Inaccurate Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: otherOperating System: Any

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 24 Feb 2017 10:23:34 PM UTC, comment #4:

yes, this fixes the issue for me.


A.R. Burgers <arb>
Tue 21 Feb 2017 09:12:56 PM UTC, comment #3:

This turned out not to be that hard. Fixed here:

I'll attach a csv2cell.cc here.

1. do:
which csv2cell
and note the location where csv2cell.oct lives.

2. Then compile attached csv2cell.cc using (in an octave terminal):

mkoctfile csv2cell.cc

and move the csv2cell.oct into the place you noted in step 1.

Please report back if your issues has been fixed.

(file #39807)

Philip Nienhuis <philipnienhuis>
Project Member
Mon 20 Feb 2017 06:24:28 PM UTC, comment #2:

On Mageia-5 linux I can confirm this:

Yet I have no idea how to solve this.

Philip Nienhuis <philipnienhuis>
Project Member
Tue 14 Feb 2017 08:40:12 PM UTC, comment #1:

What io package release?

On Windows, with this script:

I get:

... so at least on Windows it appears to work properly.
So I suspect that cv2cell's sensitivity for EOL type could be OS-specific; or more specific, the C++ function getline() that csv2cell invokes might be OS-dependent.
But my C++ proficiency is below par so don't take my idea to seriously.

Philip Nienhuis <philipnienhuis>
Project Member
Mon 13 Feb 2017 07:02:24 PM UTC, original submission:

csv files with CRLF line endings results strings containing a CR, with can lead to unexpected results.

Consider the file a_CRLF.csv:

and the following script

it produces this output

note the 13 entry.

A.R. Burgers <arb>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #39807:  csv2cell.cc added by philipnienhuis (10KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by arb (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 28 Feb 2017 09:15:24 PM UTCphilipnienhuisStatusReady For Test=>Fixed
      Operating SystemGNU/Linux=>Any
    Tue 21 Feb 2017 09:12:56 PM UTCphilipnienhuisAttached File-=>Added csv2cell.cc, #39807
      StatusConfirmed=>Ready For Test
    Mon 20 Feb 2017 06:24:28 PM UTCphilipnienhuisStatusNone=>Confirmed

    Back to the top

    Powered by Savane 3.1-cleanup1