Spool Output from UNIX to Windows Includes Linefeed (LF) but is Missing Carriage Return (CR) at the End of Each Line (Doc ID 1626735.1)

Last updated on MARCH 08, 2017

Applies to:

SQL*Plus - Version 11.1.0.6 and later
Information in this document applies to any platform.

Symptoms

The spool output is garbled. The spool file is opened on MS Windows machine but it was generated in UNIX or Linux. When opened in MS Notepad or Wordpad, it is missing Linefeed at the end of each line. It just includes the Carriage Return.

 


"0d"X (CR / CARRIAGE RETURN)

"0a"X (LF / LINEFEED)

 

Opened the original spool file in UNIX/Linux using vi in hex and the CR (hex 0d) is not there, just the LF (hex 0a):

 

vi myspool_file.out

<ESC>:%!xxd

0000000: 5351 4c3e 2073 656c 6563 7420 4f42 4a45  SQL> select OBJE
0000010: 4354 5f4e 414d 452c 2053 5542 4f42 4a45  CT_NAME, SUBOBJE
0000020: 4354 5f4e 414d 4520 6672 6f6d 2075 7365  CT_NAME from use
0000030: 725f 6f62 6a65 6374 733b 0a53 5953 4441  r_objects;.SYSDA

:%!xxd -r to exit from hex mode.

 

The vi displays the spooled output correctly in Unix and Linux. The issue just reproduces when transferring this output to MS Windows.



Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms