Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: UTL_FILE Extra FormFeed in Windows??

RE: UTL_FILE Extra FormFeed in Windows??

From: Powell, Mark D <mark.powell_at_eds.com>
Date: Thu, 27 May 2004 10:23:15 -0400
Message-ID: <564DE4477544D411AD2C00508BDF0B6A1CE0AB5F@usahm018.exmi01.exch.eds.com>


I though MS used the New Line character also known as the Line Feed, chr(10), and a Carriage Return, chr(13) to terminate a text file line while UNIX uses just the NL. Regardless of the exact character code value, if your file is going to be used in a MS environment it is correct. If you are going to use it in a UNIX environment then if you use an ASCII mode FTP to transfer the file the FTP software should automatically strip the extra character out just as it should add it in when transferring from a UNIX platform to a MS platform.

There are utilities available that add/strip the proper characters into/from text files for use between the two systems. You can probably find some of them via a google search.

HTH -- Mark D Powell --

-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of k.sriramkumar_at_iflexsolutions.com
Sent: Thursday, May 27, 2004 10:00 AM
To: oracle-l_at_freelists.org
Subject: UTL_FILE Extra FormFeed in Windows?? Importance: High

Hi Gurus,  

I have the following code, when I run this code in a DB on unix, it runs perfectly but when I run this code in DB on windows, it adds a additional form feed character(chr(12)) at the end.  

 CREATE OR REPLACE PROCEDURE edi_tst IS
 out_file UTL_FILE.file_type;
 out_line VARCHAR2 (200);
 begin

 out_file := UTL_FILE.fopen ('c:\', 'tst.txt', 'w',32000);
 UTL_FILE.put (out_file, 'TEST');
 utl_file.new_line(out_file, 1);
 UTL_FILE.put(out_file, 'TEST Line 2');
 UTL_FILE.put(out_file, 'TEST');
 UTL_FILE.fclose(out_file);

 end;  

Output of Octal Dump for a file created in Windows  

/tmp> od -bc tst.txt

0000000   T   E   S   T  \n   T   E   S   T       L   i   n   e       2
        124 105 123 124 012 124 105 123 124 040 114 151 156 145 040 062
0000020   T   E   S   T  \n
        124 105 123 124 012
 

Any clues how to avoid the extra form feed character??

Best Regards

Sriram Kumar  



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html

-----------------------------------------------------------------
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to: oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Thu May 27 2004 - 09:21:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US