Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file processing ends when ascii code 26 encountered.

Status
Not open for further replies.

zarleyman

MIS
Feb 20, 2007
4
GB
Whenever my awk program sees a record which contains the non-printable character given by ascii code 26 (), it simply stops processing as if it met the end-of-file.
It does not process the record which contained the ascii-26 character.
(I am using gawk).
I am eternally grateful to anyone who can show me how to avoid this behaviour.
Thanks.
 
Which Operating System ?
^Z is the end-of-file character in MS-Dos.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi,
Thanks for your reply.

I am transferring the file from hp-ux onto windows NT and processing it there.
I understand that ascii-26 is sometimes interpreted as end-of-file. However, many tools (even on windows, eg notepad) just display a non-printable and continue on to all the other records in the file.
If I could get awk to do that it would solve my problem.

Thanks
 
possible workaround: Can't you let awk on the hp-ux box process the file?

From what I've googled on gawk, it doesn't seem like you can get gawk to ignore the ctrl-Z end-of-file marker...


HTH,

p5wizard
 
Hi.
Unfortunately I don't have that facility. All my processing must be done on the windows side.
The best option I can think of so far is to pre-process the files with another tool to search&replace the ascii-26 away.
z.
 
possibly:

tr -d "\032" <infile >outfile

from cygwin

HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top