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 Feb 13 19:02:24 2017  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Inaccurate Result
Status: Ready For TestAssigned to: None
Originator Name: Open/Closed: Closed
Release: otherOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Fri Feb 24 22:23:34 2017, comment #4:

yes, this fixes the issue for me.

Thanks!

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

This turned out not to be that hard. Fixed here:
http://hg.code.sf.net/p/octave/io/rev/1cfd8cf0f58a

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 Feb 20 18:24:28 2017, 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 Feb 14 20:40:12 2017, 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 Feb 13 19:02:24 2017, 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):
   
   
Comment:
   

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue Feb 21 21:12:56 2017philipnienhuisAttached File-=>Added csv2cell.cc, #39807
      StatusConfirmed=>Ready For Test
      Open/ClosedOpen=>Closed
    Mon Feb 20 18:24:28 2017philipnienhuisStatusNone=>Confirmed
      Releasedev=>other

    Back to the top


    Powered by Savane 3.1-cleanup1