Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Need A Split File Option

Re: Need A Split File Option

From: Stephane Faroult <>
Date: Thu, 13 Nov 2003 12:04:26 -0800
Message-ID: <>


   Tell them to type

       man awk

 Your instinct is right :-).


Tracy Rahmlow wrote:
> A developer in our shop would like to read an input file and based on some
> field values for each record in the file split them into multiple files. The
> output files will be used by a 3rd party package for processing. (the package
> does not need the oracle database) For example:
> Input File:
> record a: WI auto ...
> record b: WI auto ...
> record c: NY auto ...
> record d: YY home ...
> Output file WI_AUTO:
> record a: WI auto ...
> record b: WI auto ...
> Output file NY_AUTO:
> record c: NY auto ...
> Error file:
> record d: YY home ... (no entry in the criteria lookup table to pick up this
> record therefore send it to an error file)
> Their solution is to load an oracle table with the input file. An additional
> table would contain the criteria and the name of the output file to write to.
> They would write a procedure to read the criteria and input table and utilize
> the utl_file package to create the output files. There may be 50+ output files
> initially and likely will grow over time. My gut tells me that this does not
> belong in the database, rather we should be able to split the file using C or a
> utility such as syncsort (which we do not have). We are currently at
> on AIX 4.3.3. Is there a more elegant solution and what would it be??? Are
> there any open source unix utilities that may help? Thanks

Please see the official ORACLE-L FAQ:
Author: Stephane Faroult

Fat City Network Services    -- 858-538-5051
San Diego, California        -- Mailing list and web hosting services
To REMOVE yourself from this mailing list, send an E-Mail message
to: (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Nov 13 2003 - 14:04:26 CST

Original text of this message