Home » SQL & PL/SQL » SQL & PL/SQL » chr(10) function to read 4 lines
chr(10) function to read 4 lines [message #39932] Sun, 25 August 2002 16:02 Go to next message
hshah
Messages: 6
Registered: August 2002
Junior Member
create or replace procedure frisho as
fHandle UTL_FILE.FILE_TYPE;
file_handle UTL_FILE.FILE_TYPE;
retrieved_buffer varchar2 (32637);
v_column5 varchar2(100) := 'Contracting Office Name and Address';
begin
file_handle := utl_file.fopen('c:hemanth','frishoin.txt','R');
fHandle := UTL_FILE.FOPEN('c:hemanth','frishoout.txt','w');
loop
begin
retrieved_buffer := null;
utl_file.get_line (file_handle, retrieved_buffer);
if substr(retrieved_buffer, 1, length(v_column5) )=v_column5 then
retrieved_buffer := substr(retrieved_buffer, length(v_column5)+1, length(retrieved_buffer))||',';
UTL_FILE.PUTF(fHandle,replace(retrieved_buffer,chr(9)));
end if;
exception
when no_data_found then
exit;
null;
end;
end loop;
UTL_FILE.FCLOSE(file_Handle);
UTL_FILE.FCLOSE(fHandle);
end frisho;
/
show err;

I want to read following text:
Contracting office name and address
XYZ co
1544 Smith Lane
falls chuch,va 22045

above code does not work? how do you use chr(10) to go to next line and read? Thanks
Re: chr(10) function to read 4 lines [message #39934 is a reply to message #39932] Mon, 26 August 2002 07:11 Go to previous messageGo to next message
Dhiren
Messages: 43
Registered: July 2002
Member
Didnt get your question , does the input file have
char(10) - new line character after xyz co,
1544 smith lane and falls church????
Dhiren
Re: chr(10) function to read 4 lines [message #39951 is a reply to message #39932] Tue, 27 August 2002 16:25 Go to previous message
hshah
Messages: 6
Registered: August 2002
Junior Member
no it is chr(10) function (newline)
Previous Topic: Epoch date...what is the difference
Next Topic: minus operator
Goto Forum:
  


Current Time: Wed Apr 24 16:36:40 CDT 2024