bugGNU Octave - Bugs: bug #50200, ods2oct() truncates cell text at...

 
 

bug #50200: ods2oct() truncates cell text at first linefeed within the cell

Submitted by:  ralf <rapete>
Submitted on:  Wed 01 Feb 2017 01:15:22 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Philip Nienhuis <philipnienhuis>
Originator Name: rapeteOpen/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.

 

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

Fri 03 Feb 2017 11:00:56 PM UTC, comment #7:

Just posted a similar bug #50224 with csv2cell().

ralf <rapete>
Fri 03 Feb 2017 08:05:28 PM UTC, comment #6:

To be sure I checked the other interfaces for multi-line text cell I/O.

For .xls / .xlsx, POI and JXL can't write multi-line text cells (reading = OK). For Apache POI I'll enter a bug report upstream; JXL isn't very actively maintained anymore AFAICS.

As to .ods, OTK can neither read nor write multi-line text cells.

I fixed the other interfaces as far as needed (minor stuff) and along the way fixed a few other bugs that had escaped attention til now.

So you see, what good stuff a bug report can bring along :-)

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Wed 01 Feb 2017 09:51:13 PM UTC, comment #5:

Thank you for reporting back.

I've pushed he fix here:
http://hg.code.sf.net/p/octave/io/rev/996fd6cba367

It'll be part of I think io-2.6.0, a major io pkg overhaul in which the ods.m functions are turned into wrappers for the xls.m functions in order to:
- cut down on maintenance of lots of duplicate code
- ease inclusion of the spreadsheet & ML I/O into core Octave at some point.

As far as this bug concerns, for the time being one has to make do with the patched file attached to this bug report.

Closing report.

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Wed 01 Feb 2017 09:15:58 PM UTC, comment #4:

Tried the attached OCT_ods2oct_.m on two different ods-files.

All cells with linefeeds were read in correctly.

So the fix worked.

Thanks!

ralf <rapete>
Wed 01 Feb 2017 08:52:05 PM UTC, comment #3:

AFAICS this only happens with .ods files (for the OCT interface).

Please try attached _OCT_ods2oct_.m:

- Swap it into place in the location you get by copying the following command in the Octave terminal and then typing "pwd" (w/o dbl quotes of course):

cd (strrep (which ("ods2oct"), "ods2oct.m", "private"))

- try reding your file(s) again,
- and report back, please.

FTR, I now get:

(file #39643)

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Wed 01 Feb 2017 06:57:13 PM UTC, comment #2:

Thanks for the reply.

Tried xls2oct().

Like ods2oct(), it does truncate text cells at first linefeed inside the cells.

ralf <rapete>
Wed 01 Feb 2017 06:20:11 PM UTC, comment #1:

Thanks for the bug report. I'll have a look.

This might also be the case for other spreadsheet file formats.

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Wed 01 Feb 2017 01:15:22 AM UTC, original submission:

If there is one or more linefeeds within spreadsheet cells, then ods2oct() in package io-2.4.5 returns the content of these cells incompletely, i.e. truncated at the first linefeed.

The above code will yield T = { 'a' }, when in fact 'abs.ods' contains one cell with content "a\nb\nc". See attached abs.ods.

Operating System is Ubuntu 16.04. Octave version is 4.0.0.

ralf <rapete>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #39643:  __OCT_ods2oct__.m added by philipnienhuis (11KiB - text/x-objcsrc)
file #39636:  abc.ods added by rapete (7KiB - application/vnd.oasis.opendocument.spreadsheet - simple file that ods2oct() fails to read properly)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rapete (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 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 01 Feb 2017 09:51:13 PM UTCphilipnienhuisStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Wed 01 Feb 2017 08:52:05 PM UTCphilipnienhuisAttached File-=>Added _OCT_ods2oct_.m, #39643
      CategoryOctave Forge Package=>Octave Function
      StatusNone=>Ready For Test
      Assigned toNone=>philipnienhuis
      Release4.0.0=>other
      Operating SystemGNU/Linux=>Any
    Wed 01 Feb 2017 01:15:22 AM UTCrapeteAttached File-=>Added abc.ods, #39636

    Back to the top


    Powered by Savane 3.1-cleanup1