chr(10) function to read 4 lines [message #39932] |
Sun, 25 August 2002 16:02 |
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
|
|
|
|
|