How to Add Carriage Returns to a File Created By UTL_FILE on Unix and Read on Windows?

(Doc ID 747819.1)

Last updated on JULY 05, 2017

Applies to:

PL/SQL - Version 10.2.0.4 and later
Information in this document applies to any platform.
***Checked for relevance on 09-Jan-2014***

Goal

UTL_FILE.PUT_LINE terminates a line of text with a platform-specific line terminator character or characters.  On Unix this is Line Feed (LF).  On Windows this is LF and Carriage Return (CR).

If your file is created on Unix and you need to read it on Windows you will need to re-format the file to include CR.

Solution

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