bugGNU Octave - Bugs: bug #52484, csvread/dlmread should support or...

 
 

bug #52484: csvread/dlmread should support or detect newline option

Submitted by:  None
Submitted on:  Wed 22 Nov 2017 08:56:37 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Works For MeAssigned to: None
Originator Name: paulfrischknechtOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.0.1
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Thu 23 Nov 2017 03:13:26 PM UTC, comment #6:

@Dan: I'm going to close this bug, since Octave already respects the different newline endings. For the performance issue, I'll comment on bug #51871.

Rik <rik5>
Project Administrator
Thu 23 Nov 2017 09:48:02 AM UTC, comment #5:

Oh, that's right. I'm recalling now. Thanks.

That bug refers to this bug:

https://savannah.gnu.org/bugs/?51871

which I think we left off with Rik wondering what parts of his patch could still be used. I didn't write an actual patch (which is what I was searching for), just wrote some comments with regard to Rik's modification. My feeling was that all of it could be reused if we just wrote a custom getline-like routine that handles all three EOL symbols.

I was also thinking that I could speed that getline-like routine up by not wiping the referenced string clean with each new line read, but instead reuse the string placing an EOL character in the appropriate location of the string or expanding the string if the line gets longer in the file. I've a feeling that might reduce that load time a good fraction because there won't be so much clearing/initializing strings with each line in the file.

Rik, should I work a bit on your proposed changeset at the link above and create another version? It might be easier doing what I have in mind than explaining it to you so that you may update the patch.

Dan Sebald <sebald>
Thu 23 Nov 2017 07:23:16 AM UTC, comment #4:

See http://savannah.gnu.org/bugs/?52355 for the str where the line ending example was posted.

A.R. Burgers <arb>
Wed 22 Nov 2017 11:45:00 PM UTC, comment #3:

Yes, I asked for a test file that had all three line endings in a single file to be tested. Turns out both Octave and Matlab can read these files perfectly.

Rik <rik5>
Project Administrator
Wed 22 Nov 2017 10:13:12 PM UTC, comment #2:

Didn't we just address something like this? I recall Rik generating a file having all combinations of EOL characters and testing it in some way, but my head is spinning from all the recent textscan/cvsread/dlmread issues, fixed and not fixed.

Dan Sebald <sebald>
Wed 22 Nov 2017 09:42:16 PM UTC, comment #1:

4.0.1 is deprecated and no longer supported. Please try with the latest stable version, 4.2.1. I tried it and it appears to work. See the attached file x.csv which has CR/LF endings (DOS) but loads fine on Linux with

(file #42461)

Rik <rik5>
Project Administrator
Wed 22 Nov 2017 08:56:37 PM UTC, original submission:

Standard matlab can import csv's with any newline type (\r, \n, \r\n) on all systems. However, octave treats line endings created on a different system incorrectly.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #42461:  x.csv added by rik5 (21B - text/csv)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by arb (Posted a comment)
  • -unavailable- added by sebald (Posted a comment)
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by None (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 23 Nov 2017 03:13:26 PM UTCrik5Open/ClosedOpen=>Closed
    Wed 22 Nov 2017 09:42:16 PM UTCrik5Attached File-=>Added x.csv, #42461
      StatusNone=>Works For Me

    Back to the top


    Powered by Savane 3.1-cleanup1