Re: Text File from Informix Database
Posted in 1999
Topics: Migration, Import/Export & Data Conversion
You will probably have to resort to an awk script, using "|" as the field separator and then using printf() to get exactly the format you want. At least, that's what I ended up doing a few years ago. > How can I get a text file ( unload or output) from a Informix Database with > the blank spaces that belong to the end of fields. > My problem is I have a Cobol program that will read this file, so I need > fixed length fields. > > For Example: > > In a text file created by an Informix Database, the fields appear : > > 1234|Adam Smith|single|04/01/1961 > 1235|Joan Norton Maguire|married|08/10/1970 > > I need: > > 1234|Adam Smith |single |04/01/1961 > 1235|Joan Norton Maguire |married |08/10/1970 > > The Informix version is 5.10. The command used is "unload". > > If you have some suggestion I would aprecciate ............. Mark Collins mcollins@us.dhl.com The problem lies in how easily and dangerously we forget that manipulating things is not the same as understanding them.
Mark Collins <mcollins@us.dhl.com> writes: > You will probably have to resort to an awk script, using "|" as the > field separator and then using printf() to get exactly the format > you want. At least, that's what I ended up doing a few years ago. "awk", foo! Perl is your friend. -- Forte International, P.O. Box 1412, Ridgecrest, CA 93556-1412 Ronald Cole <ronald@forte-intl.com> Phone: (760) 499-9142 President, CEO Fax: (760) 499-9152 My PGP fingerprint: 15 6E C7 91 5F AF 17 C4 24 93 CB 6B EB 38 B5 E5