GAWK Incorrect Data Display
Norton Allen
allen@huarp.harvard.edu
Sun Dec 20 12:19:34 GMT 2020
On 12/19/2020 7:16 PM, Hans-Bernhard Bröker wrote:
> Am 20.12.2020 um 00:34 schrieb Jason McGee via Cygwin:
>> I confirmed there is not a problem with my code by comparing Cygwin
>> against Gawk for Windows.
>
> Your presentation of the problem is quite unclear, but the root cause
> is almost certainly not in the code, but in the data.
>
> You're bound to be feeding Windows text files to a Unix tool. You
> need to reformat the file to Unix format.
>
I agree. The input likely has <cr><lf> line endings. Cygwin's gawk
expects just <lf>, so the <cr> gets wrapped into the regular line text.
Your ", 0" is not replacing the beginning of the line, it is
overprinting it after the <cr>.
More information about the Cygwin
mailing list