Hi ,
I do have a fixedwidth flatfile that has data for 10 different datasets each identified by the first two digits in the flatfile.
01 in the first two digit position refers to Set A
02 in the first two digit position refers to Set B and so on
I want to genrate 10 different files from my fixedwidth file , each file having it's own record set.
File A.dat having only 01 records.
File B.dat having only 02 records and so on.
Hi Corona,
Thank you very much
this works good but how can I get specific output filename to specific first two digits like
01 will get filename as MEM.dat
02 will get filename as DEPT.dat
also there is requirement where 04 and 05 both go into single file called sale.dat
In that case create an associative array that maps the 2 digits with the desired filename...read/parse each input file record...and output it to the specific filename based on the numerical code.
It creates an array "file" with the output file names. file[1]=MEM, file[2]=DEPT etc. The data from the actual file is used as the index for obtaining the file names from this array and print the data.