KSH: A PROBLEM awk SUBSTRING

Hi Gurus,
I am working with a korn shell script to simplify some operations of creation file of spool for a Bulk-Copy. Thi is my code:

In a for cycle:

gzcat ${file} |awk '{ print substr($0,1,5)";"substr($0,108,122)";"substr($0,124,131)";"substr($0,139,152)";"substr($0,154,163)";"}' >> FileBcp.bcp

but in output I don't get only the interested columns, but the more columns the whole line...

This is what I would want:

43031;20110128080700;ALBAM01;0;20110128080700;001234567;

questo � quello che ottengo:

 43031;20110128080700;ALBAM01;0;20110128080700;001234567;012535007124830                  *TAP3V1*03314             *393291408157   *033;            ;         ;00           ;012535007124830                  *TAP3V1*03314             *393291408157   *03314*            *     1111          +;       ;00           ;012535007124830                  *TAP3V1*03314             *393291408157   *03314*            *     1111          +010032          355680200*;

where is the error?

I would want to bring on an only file

try switching the print statement to a printf statement:

gzcat ${file} |awk '{
  printf("%s;%s;%s;%s;%s;%s;\n",substr($0,1,5),substr($0,108,122),substr($0,124,
131),substr($0,139,152),substr($0,154,163))
}' >> FileBcp.bcp

good idea, but I get this error:

 
gzcat: compressed data not read from a terminal. Use -f to force decompression.

gzcat cats a gzipped file it does not compress.
The gzcat utility behaves just like the gunzip -c command. (On some systems, gzcat is installed as zcat

Hi,
the command works, but the result is not correct. In output it always brings the whole line....

So your script worked with the gzcat but just gave bad output. But now it gives a gzcat error?
hmmm all I did was change from print to printf in the awk should not have affected the gzcat.

I guess I may need more view of the script. and a small sample of the file.

all ok I mistook me...!!!!

Thanks