[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Read a fixed length of input each time
From: |
Peng Yu |
Subject: |
Re: Read a fixed length of input each time |
Date: |
Tue, 23 Jun 2020 11:45:32 -0500 |
For example, I may do the revert processing to get back the integers
from the binary stream. For this kind of fixed binary stream, I feel
the awk syntax would be better than writing a much longer Go file.
For example, if gawk would be able to split fields based on fixed
field width and a fixed number of NF. Then, I may simply write awk
code like the following (suppose that there is a bin2uint() function).
It would be must shorter than the equivalent Go code to convert such
binary stream to integers.
$ awk -e '{ for(i=1;i<=NF;++i) { print bin2unit($i) }'
On 6/23/20, Andrew J. Schorr <aschorr@telemetry-investments.com> wrote:
> On Tue, Jun 23, 2020 at 11:38:32AM -0500, Peng Yu wrote:
>> It is to deal with binary files. For example, I may create a binary
>> stream using the following Go file.
>
> Thanks, but my question is not how you created the file. My question
> is what sort of useful processing of the binary data you plan to do
> inside gawk and how that would work. The AWK language is great for
> text, but I'm wondering why it's useful for binary data. What do
> you want to do with the binary data inside gawk?
>
> Regards,
> Andy
>
--
Regards,
Peng
- Read a fixed length of input each time, Peng Yu, 2020/06/22
- Re: Read a fixed length of input each time, arnold, 2020/06/23
- Re: Read a fixed length of input each time, Neil R. Ormos, 2020/06/23
- Re: Read a fixed length of input each time, Andrew J. Schorr, 2020/06/23
- Re: Read a fixed length of input each time, Peng Yu, 2020/06/23
- Re: Read a fixed length of input each time, Andrew J. Schorr, 2020/06/23
- Re: Read a fixed length of input each time,
Peng Yu <=
- Re: Read a fixed length of input each time, Andrew J. Schorr, 2020/06/23
- Re: Read a fixed length of input each time, Peng Yu, 2020/06/23
- RE: Read a fixed length of input each time, Tom Gray, 2020/06/23
- Re: Read a fixed length of input each time, Neil R. Ormos, 2020/06/23
- Re: Read a fixed length of input each time, Andrew J. Schorr, 2020/06/23
- Re: Read a fixed length of input each time, Neil R. Ormos, 2020/06/23