help-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Creating strings of binary zero characters


From: Wolfgang Laun
Subject: Fwd: Creating strings of binary zero characters
Date: Tue, 31 Aug 2021 18:21:07 +0200

You can create character values in hex or octal notation. So here you have
two null characters in a string:
    BEGIN {  print "NULL:\x00NULL:\000\n"; }
Here are the NULL characters in the output:
   wlaun@terra:/tmp$ gawk -f null.awk  | od -tx1
   0000000 4e 55 4c 4c 3a 00 4e 55 4c 4c 3a 00 0a 0a

WL

On Tue, 31 Aug 2021 at 17:26, <pjfarley3@earthlink.net> wrote:

> I have an application that needs to generate a header record in an
> otherwise
> text file where the header record has a key of binary zero characters in
> the
> first N bytes followed by normal text data like current date and other
> file-identifying information.
>
>
>
> Is there a way to generate a string of binary zero characters of length N
> using only gawk?  Or do I need to use another tool to accomplish that task?
>
>
>
> Peter
>
>

-- 
Wolfgang Laun



-- 
Wolfgang Laun


reply via email to

[Prev in Thread] Current Thread [Next in Thread]