Generated comma-delimited files

Vaughn Seward vaughn@sewardconsulting.com
Fri, 12 Jul 2002 08:38:45 -0600


We were constantly needing a comma-separated format a few years back and 
since we were in a Unix environment I decided to use the available tools 
and came up with the following solution. Anyone who needs a comma-delimited 
format simply outputs whatever subfile they need as a portable subfile 
(portable subfiles come with a mini-dictionary).

A shell command we created uses the AWK scripting language and does the 
following to generate the required comma-delimeted file:

1. An AWK script reads the dictionary part of the portable subfile and 
generates a one-time QTP program.

2. The one-time QTP program is executed and reads the data part of the 
portable subfile and generates the requried comma-delimeted file as another 
subfile. The contents of of this subfile are the text fields as defined in 
the mini-dictionary separated by a constant "," field (numeric fields are 
converted to character). The resulting subfile can be as wide as you like.

3. The last thing the shell command does is clean things up with another 
AWK script that stripps out the spaces between the fixed-width columns in 
the subfile.

P.S. The real trick is reading a comma-delimited or XML file into a 
PowerHouse system. For this we have used Quick with its 3GL flexibility.

~Vaughn Seward
Seward Consulting Ltd.

At 2002/07/12 07:35, you wrote:
>Rather than this messy way, how about using plain old every day Quiz?
>
>...
>
>While I'm wishing for things I'd also like to see options to create tab
>delimited and/or comma separated output formats.
>
>Regards,
>JWP