Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

UTL_FILE.PUT_LINE question

Posted on 2011-02-18
3
Medium Priority
?
794 Views
Last Modified: 2013-12-19
I am creating a comma delimited text file (i.e a 'csv' file) using the utl_file.put_line. When I open the resulting file in 'notepad' the data is one contigous line (i.e. no cr/lf), but when I open the file in other editors like UltraEdit the cr/lf are there.
Has anyone come accross this before?
0
Comment
Question by:SpyHop
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 34929636
From the docs:

PUT_LINE terminates the line with the platform-specific line terminator character or characters.

http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/u_file.htm#ARPLS70942

Notepad isn't all that smart and PUT_LINE might not be writing an actual cr/lf.  It might just be one or the other.

To check this theory, open the file in a hex editor and look at what PUT_LINE is writing.
0
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 100 total points
ID: 34929650
are you sure you're writing both characters?  chr(13) and chr(10)  

Note pad requires both,  other, smarter editors, like Ultraedit recognize other end-of-line conventions and display accordingly
0
 
LVL 35

Accepted Solution

by:
johnsone earned 100 total points
ID: 34929754
Sounds typical of a file generated on a UNIX server and then brought over to a Windows system.

If you use ftp to transfer the file between the 2 operating systems, be sure you do it in ASCII mode, that will do the end of line transformation for you during the transfer.  Even programs that attempt to detect the file type don't always get it right, don't rely on automatic, always specify the type.  If you are using a command line ftp to transfer the file, the command it typically "TYPE ASCII", however it does very.

Wordpad is also an editor that will open the file correctly.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Via a live example, show how to take different types of Oracle backups using RMAN.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question