bugPSPP - Bugs: bug #41852, Exporting sav-Files to csv: Dos...

 
 

bug #41852: Exporting sav-Files to csv: Dos linebreaks in table cells are exported (unchanged).

Submitted by:  Andre Müller <andrem>
Submitted on:  Thu 13 Mar 2014 01:15:39 PM UTC  
 
Category: Output DriverSeverity: 5 - Average
Status: FixedAssigned to: None
Open/Closed: ClosedRelease: None
Effort: 0.00

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sun 16 Mar 2014 06:49:41 PM UTC, comment #1:

I applied a commit that should write out proper system-specific line breaks even if table cells contain CR-LFs.

I think it would be going too far to completely ignore line breaks in table cells.

Ben Pfaff <blp>
Project Administrator
Thu 13 Mar 2014 01:15:39 PM UTC, original submission:

SPSS sav files may contain line breaks as cell content.
When exporting to .csv, these are exported "as is",
that is I find DOS line breaks (CR-LF) in Table cells,
even though the table itself is written to linux file
format (only LF as line breaks).

The export is done using
GET FILE="source.sav"
SAVE TRANSLATE
/TYPE=TAB
/FIELDNAMES
/OUTFILE="pspp_out.csv"

An example file can be downloaded from (needs registration):
https://dbk.gesis.org/dbksearch/download.asp?db=D&id=35706

The file's third row contains a Dos line break:

<foo> "FRAGEBOGEN GEMEINSAM MIT MEINER MUTTER AUSGEFÜLLT, DA ICH EINIGE FRAGEN OHNE IHRE UNTERSTÜTZUNG NICHT HÄTTE BEANTWORTEN KÖNNEN. Z.B. WOHNUNG^M
" <bar>

A newline is introduced, and a ^M denoting a carriage return is
trailing at the end of line.

All instances of cells containing line breaks I encountered are actually cut-and-paste accidents, none of them serves a layout purpose.

In my opinion, the export to csv should not export the line breaks at all, as it screws up the table geometry (one line per case containing all columns). Handling the csv with the
standard unix tools (cut, paste, grep..) will not work as expected. But that really is just my opinion :-)

If the line breaks are exported, they should match the current file encoding, though. So in this case, Unix line feeds should be written instead of DOS ones.

I post this bug following up on my inquiry to pspp bugs mailing list of 2014-03-12, with the subject "PSPP-BUG: DOS Linebreaks in Table Cells: Intentionally exported?"

Andre Müller <andrem>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by blp (Posted a comment)
  • -unavailable- added by andrem (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 logged-in users can vote.

     

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

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 16 Mar 2014 06:49:41 PM UTCblpStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1