Is it possible to generate the .CSV file with pipe (|
) delimiters instead of comma (,
) through UTL_FILE package?
Kindly share me how to do if it is possible.
Thanks, Janardhan.
Sure you can write nearly anything in a csv file ...
declare
v_file utl_file.file_type;
begin
v_file := utl_file.fopen('DATA_FILE_DIR', 'example2.csv', 'W');
utl_file.put_line(v_file, 'colid|colstring|colnumber|coldate');
utl_file.put_line(v_file, '1|"nothing"|231.12|2019-01-03 23:43:32');
utl_file.put_line(v_file, '2|"not more"|121|2020-10-05 14:33:15');
utl_file.FFLUSH(v_file);
utl_file.fclose(v_file);
end;
when i open the CSV file, all the data will be available in a single column Is it possible to separate the data based on the Pipe delimited?
That is a feature of MS Excel, regardless of how the file was produced. What you need to do is
|
in the boxExcel will now open your file with multiple columns as defined by the pipes.