X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 221CA3861031
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
 header.from=huarp.harvard.edu
Authentication-Results: sourceware.org;
 spf=pass smtp.mailfrom=allen@huarp.harvard.edu
Subject: Re: GAWK Incorrect Data Display
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
References: <DM6PR12MB2922892E5E2BE6301BDAC818BBC20@DM6PR12MB2922.namprd12.prod.outlook.com>
 <b948aa3b-78b5-c4ad-47b5-f3ded93f8bfc@t-online.de>
From: Norton Allen <allen@huarp.harvard.edu>
Message-ID: <8aaa6927-34db-e61c-052d-519a23231009@huarp.harvard.edu>
Date: Sun, 20 Dec 2020 07:19:34 -0500
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
 Thunderbird/78.5.1
MIME-Version: 1.0
In-Reply-To: <b948aa3b-78b5-c4ad-47b5-f3ded93f8bfc@t-online.de>
Content-Language: en-US
X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
 NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS,
 TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 0BKCK3cb013461

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>.


--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

