Solved

Send CR/LF using UTL_FILE?

Posted on 2004-04-06
7
2,943 Views
Last Modified: 2009-10-20
Using UTL_FILE, how can I send a carriage-return/line-feed set (0x0d 0x0a) to a file?

Everything I try sends the 4 characters '13' and '10'.
0
Comment
Question by:BrianWren
[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
7 Comments
 

Expert Comment

by:smohan7
ID: 10770296
Brian,
Did you try this?

utl_file.putf(out_file,'\n/\n');

Thanks
Mohan
0
 
LVL 5

Expert Comment

by:mudumbe
ID: 10771107
You can use the one defined in UTL_TCP package:  UTL_TCP.CRLF
0
 
LVL 5

Expert Comment

by:KarcOrigin
ID: 10771237
Hi,
Use UTL_FILE.PUT_LINE

actually there are 2 method UTL_FILE.PUT to print the line on the same line and UTL_FILE.PUT_LINE to print the line and and line break.
Thx
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:baonguyen1
ID: 10771428
BrianWren, you can PUT and PUT_LINE. However, there is a different:

Use of PUT_LINE will flush the buffer to file and generate a new line
PUT just puts tring to the buffer. You then need to use FFLUSH  to generate a carriage return and flush the contents the buffer to the file after using the UTL_FILE.PUT procedure.

You also can use PUTF()

Hope this helps
0
 
LVL 9

Author Comment

by:BrianWren
ID: 10775117
I actually asked the wrong question...
(End of a long day...)

What I want to know how to do is send a form feed, 0x0C.

(I fooled myself as well.  I really did try to manually write 0x0D 0x0A to a file.  
 I actually have been using PUT_LINE, and came to this point where I need to
 generate a page.)

aHEm...
  ¯¯

Using UTL_FILE, how can I send a form-feed (0x0c) to a file?

I really apologize for being boneheaded.  
If anyone has an answer to the way to send a FormFeed, i'd really like to know the answer.
0
 
LVL 9

Accepted Solution

by:
pratikroy earned 250 total points
ID: 10779130
I believe form feed (Page Break) character is 12 (0x0c).

So, you can try putting the chr(12) using the UTL_FILE.

I would be eager to know if that works :)
0
 
LVL 9

Author Comment

by:BrianWren
ID: 10779288
CHR() was what I needed to know.

I am a VB programmer, so I knew about CHR(), but I thought Oracle's substitute for that was TO_CHAR(), and I could find no way to make TO_CHAR() act like Chr$() [from VB].

Thanks!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to recover a database from a user managed backup
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

689 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