public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: awk question : 0x1a - file end problem
@ 1999-09-14  5:59 Earnie Boyd
  1999-09-30 23:42 ` Earnie Boyd
  0 siblings, 1 reply; 6+ messages in thread
From: Earnie Boyd @ 1999-09-14  5:59 UTC (permalink / raw)
  To: Lasslop, Andre

--- "Lasslop, Andre" <Andre.Lasslop@vs.dasa.de> wrote:
> Hello,
> 
> I'm trying to scan binary files (log files of serial i/o, contains lists of
> binary messages with header,tail, and timestamp) with the awk - program. The
> awk-script does what I want. The only problem I detect is, if a 0x1a - Byte
> occurs within the input file this is interpreted as a premature end of file
> ! I know, the awk program is for text-file scanning. Therefore : is there
> any other possibility to scan such binary files for byte-patterns without
> programming such tool by myself ?

The most sure way is to get the source for awk and add a switch to indicate
that you want to process in binary mode and then ensure that the fd's are set
to O_BINARY when the switch is used.

For the time being you can use binary mounts to achieve binary mode defaults. 
Caution, scripts and source files with \r\n will need to be modified to \n
only.  
===
Earnie Boyd < mailto:earnie_boyd@yahoo.com >

Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >

(If you respond to the list, then please don't cc me)
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: awk question : 0x1a - file end problem
  1999-09-14  5:59 awk question : 0x1a - file end problem Earnie Boyd
@ 1999-09-30 23:42 ` Earnie Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Earnie Boyd @ 1999-09-30 23:42 UTC (permalink / raw)
  To: Lasslop, Andre, cygwin

--- "Lasslop, Andre" <Andre.Lasslop@vs.dasa.de> wrote:
> Hello,
> 
> I'm trying to scan binary files (log files of serial i/o, contains lists of
> binary messages with header,tail, and timestamp) with the awk - program. The
> awk-script does what I want. The only problem I detect is, if a 0x1a - Byte
> occurs within the input file this is interpreted as a premature end of file
> ! I know, the awk program is for text-file scanning. Therefore : is there
> any other possibility to scan such binary files for byte-patterns without
> programming such tool by myself ?

The most sure way is to get the source for awk and add a switch to indicate
that you want to process in binary mode and then ensure that the fd's are set
to O_BINARY when the switch is used.

For the time being you can use binary mounts to achieve binary mode defaults. 
Caution, scripts and source files with \r\n will need to be modified to \n
only.  
===
Earnie Boyd < mailto:earnie_boyd@yahoo.com >

Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >

(If you respond to the list, then please don't cc me)
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: awk question : 0x1a - file end problem
  1999-09-19 11:01 ` Michael Hirmke
@ 1999-09-30 23:42   ` Michael Hirmke
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Hirmke @ 1999-09-30 23:42 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 658 bytes --]

Lasslop, Andre [Andre.Lasslop@vs.dasa.de] wrote:

[...]
>! I know, the awk program is for text-file scanning. Therefore : is there
>any other possibility to scan such binary files for byte-patterns without
>programming such tool by myself ?

Perl?

>
>I'm using cygwin b20.1, NT4.0.
>
>Thanks
>
>André Lasslop

Bye.
Michael.
--
Michael Hirmke           | Telefon +49 (911) 557999
Georg-Strobel-Strasse 81 | FAX     +49 (911) 557664
90489 Nuernberg          | E-Mail  mailto:mh@mike.franken.de
                         | WWW     http://aquarius.franken.de/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* awk question : 0x1a - file end problem
  1999-09-14  5:22 Lasslop, Andre
  1999-09-19 11:01 ` Michael Hirmke
@ 1999-09-30 23:42 ` Lasslop, Andre
  1 sibling, 0 replies; 6+ messages in thread
From: Lasslop, Andre @ 1999-09-30 23:42 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 652 bytes --]

Hello,

I'm trying to scan binary files (log files of serial i/o, contains lists of
binary messages with header,tail, and timestamp) with the awk - program. The
awk-script does what I want. The only problem I detect is, if a 0x1a - Byte
occurs within the input file this is interpreted as a premature end of file
! I know, the awk program is for text-file scanning. Therefore : is there
any other possibility to scan such binary files for byte-patterns without
programming such tool by myself ?

I'm using cygwin b20.1, NT4.0.

Thanks

André Lasslop

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: awk question : 0x1a - file end problem
  1999-09-14  5:22 Lasslop, Andre
@ 1999-09-19 11:01 ` Michael Hirmke
  1999-09-30 23:42   ` Michael Hirmke
  1999-09-30 23:42 ` Lasslop, Andre
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Hirmke @ 1999-09-19 11:01 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 658 bytes --]

Lasslop, Andre [Andre.Lasslop@vs.dasa.de] wrote:

[...]
>! I know, the awk program is for text-file scanning. Therefore : is there
>any other possibility to scan such binary files for byte-patterns without
>programming such tool by myself ?

Perl?

>
>I'm using cygwin b20.1, NT4.0.
>
>Thanks
>
>André Lasslop

Bye.
Michael.
--
Michael Hirmke           | Telefon +49 (911) 557999
Georg-Strobel-Strasse 81 | FAX     +49 (911) 557664
90489 Nuernberg          | E-Mail  mailto:mh@mike.franken.de
                         | WWW     http://aquarius.franken.de/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* awk question : 0x1a - file end problem
@ 1999-09-14  5:22 Lasslop, Andre
  1999-09-19 11:01 ` Michael Hirmke
  1999-09-30 23:42 ` Lasslop, Andre
  0 siblings, 2 replies; 6+ messages in thread
From: Lasslop, Andre @ 1999-09-14  5:22 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 652 bytes --]

Hello,

I'm trying to scan binary files (log files of serial i/o, contains lists of
binary messages with header,tail, and timestamp) with the awk - program. The
awk-script does what I want. The only problem I detect is, if a 0x1a - Byte
occurs within the input file this is interpreted as a premature end of file
! I know, the awk program is for text-file scanning. Therefore : is there
any other possibility to scan such binary files for byte-patterns without
programming such tool by myself ?

I'm using cygwin b20.1, NT4.0.

Thanks

André Lasslop

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-09-30 23:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-14  5:59 awk question : 0x1a - file end problem Earnie Boyd
1999-09-30 23:42 ` Earnie Boyd
  -- strict thread matches above, loose matches on Subject: below --
1999-09-14  5:22 Lasslop, Andre
1999-09-19 11:01 ` Michael Hirmke
1999-09-30 23:42   ` Michael Hirmke
1999-09-30 23:42 ` Lasslop, Andre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).