delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/12/19/18:52:06

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B4BCF38350A2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1608421880;
bh=v/euDqs2wB1Ol8ZDRkBZJRDhq/q3Tj2Bqg4zhicqxCY=;
h=To:Subject:Date:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=lPjIyfrYjcqvI83rz9tHpQLcmv7lCr3XuUBMFFPK4mN82cNd1sgYMjcLZWqWN6yVw
dD1EBd6YA66T+Km6MtwfQroAtW6ODKC2P962IuYYoUSHHpL84D9Fl28R5nojasF47J
7O0wkm96JIncpP6OmhFN1EyKCBscuPwunfHoA3G8=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1CD0F385801E
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=L2896dkUfYq9rjG28PgXBKoEjUe+nmuND3FIe4gnTQNFE1Lzu1KE57kcSE9g1w1TXN66lHG4O0gWls2EKFW+OtplXxriy/mu7JTkdJDjTKXkSKkypvGfMELmhr3DXc2JDM1wRlEILP/InTT1cXukV4eZXjbwBjEzUSt5nJWcTszv6fomvtw4Hx9Kdsv8O2c/t8z6QM/ncNQcw3wmTJenCR77UItqmEXItRsa0KcVuOYLHos+PGeu5QDcxIvYQGSbsG5XKYupMup6wBit0iP4LFH0FheyftjPf75oiveD0VxVwlNEqliMrC4D9ns/Ue7kHxj4aMG51YhuUPVe7TX4lQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=NazdDM7a5Yekh5Am7nuEQ9N55068Vh2/3o6DwGEbkG4=;
b=K1dYC+xp7GnpKvsVkLIbA5JgwBou48jJ6fZlLJqnJ5SWdC/oF8nbNeUq1d/rvgR3mdMCXg++Y2fixvJbcH4ccvfuIU0OW6xZ19uP/NlY4iHXT1EJk/6rF8mz6O+T8opHGtlR7xEfKf907mBo+gO6qJ1MbVeZb3lKS40EpSuGGAAre1+G0sG2JMYeXaB8Ode4lgua30+mH36IaPgDQpbSHwmu72np0RFsvvMgjpNAnjxTpNYogUL2tpKZBk77KZ6zhLUMu27jWR94a993zm4pFc1FlQXaZ/f2T4Cjhf1ZhCxT2ZY3GAUCQjj/xKmq4SKMpKFk6yg04q4kdxK1tO35aQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
dkim=none; arc=none
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: RE: GAWK Incorrect Data Display
Thread-Topic: GAWK Incorrect Data Display
Thread-Index: AQHW1l5lYkl8zEHmh0CFMrQ16E6w4an/FS4/
Date: Sat, 19 Dec 2020 23:51:15 +0000
Message-ID: <DM6PR12MB29229E585095F238A91924AABBC20@DM6PR12MB2922.namprd12.prod.outlook.com>
References: <DM6PR12MB2922892E5E2BE6301BDAC818BBC20 AT DM6PR12MB2922 DOT namprd12 DOT prod DOT outlook DOT com>
In-Reply-To: <DM6PR12MB2922892E5E2BE6301BDAC818BBC20@DM6PR12MB2922.namprd12.prod.outlook.com>
Accept-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-incomingtopheadermarker: OriginalChecksum:0EDCF25EFDC071D66D526934DB7816E42086D95B2DA2F2AA3254B6236C3E1314;
UpperCasedChecksum:21252AA674B56F76E44669BEA0E6BF5DE6112D5BD326F8C98BD0684D534B34A1;
SizeAsReceived:6856; Count:44
x-ms-exchange-messagesentrepresentingtype: 1
x-tmn: [yRj8CyI1EZ26Rk/PPCRuSSlufdah7s8V]
x-ms-publictraffictype: Email
x-incomingheadercount: 44
x-eopattributedmessage: 0
x-ms-office365-filtering-correlation-id: 48a4c130-0e76-4441-15d7-08d8a478f911
x-ms-traffictypediagnostic: MW2NAM10HT106:
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: qfwvzUgHJXyCf32MEbbZUE0uW2x/cLMukAeq/j11fCaAVbn9oUGd/dCXITdWYUNcI+LmoX+28UecAjQqJqcLnrYj4ht4clWC+Q9t5CbnS/BVsP7CsNxtwChEcvJEIWpBEMELEbmCpveBjlybaSd8eB/eZtfltW0EjV6TWgPyZ1LRHPWIMxmMmKBwIguaguoKQSZ6NfrfCvFyG7pP8MiW44NlosvKIc5cYCgh+sfTKvexAvyKkJ29KwPll1lr724nU1dPo7SibdFbmyjZSDDITgouwZYgArHLUkX2DXqPSj4=
x-ms-exchange-antispam-messagedata: di4xr6kcYN2k5inf2tCE5HEoLbQ+/jr0xJ2EB1vt8x0nkjf8nZfMdrQq13C2as7hUF180hPsf92TnPSF1ZhabLDJhPQbLeSs+jgSke0lzqX47C+CFjoAYzDosNRxYo80ijZu7ngT9F4ItZtW0NXYqg==
x-ms-exchange-transport-forked: True
MIME-Version: 1.0
X-OriginatorOrg: hotmail.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-AuthSource: MW2NAM10FT011.eop-nam10.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-CrossTenant-Network-Message-Id: 48a4c130-0e76-4441-15d7-08d8a478f911
X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Dec 2020 23:51:15.2993 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Internet
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2NAM10HT106
X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE,
RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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-Content-Filtered-By: Mailman/MimeDel 2.1.29
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Jason McGee via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Jason McGee <goodmis AT hotmail DOT com>
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 0BJNpll7024788

Input Data
SP 2183197 SELL  0.01 3686.3
SP 2183197 SELL  0.01 3686.3 3680.0

I’m adding a 0 at the end,  if NF == 5


CORRECT
C:\cygwin64\home\trading_scripts>gawk -f PROCESS_INGOT.awk ingot.txt
"SP", 2183197,"SELL", 0.01, 3686.3, 0
"SP", 2183197,"SELL", 0.01, 3686.3, 3680.0


INCORRECT
gawk -f PROCESS_INGOT.awk ingot.txt
, 0", 2183197,"SELL", 0.01, 3686.3
"SP", 2183197,"SELL", 0.01, 3686.3, 3680.0

For some reason the last variable is transferred to the 1st position.


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Jason McGee<mailto:goodmis AT hotmail DOT com>
Sent: Saturday, December 19, 2020 6:34 PM
To: cygwin AT cygwin DOT com<mailto:cygwin AT cygwin DOT com>
Subject: GAWK Incorrect Data Display

I confirmed there is not a problem with my code by comparing Cygwin against Gawk for Windows.

sp_array[++ sp_count] = d_quote "SP" d_quote ", " ticket "," d_quote type ", " volume ", " price ", " 0

I’m reading a file and writing the data to an array.

I’ve tried multiple variations are the problem is certainly in the Cygwin code.

The output is messed up if I have more than 7 variables.

Thanks

cygwin
$ gawk -f PROCESS_INGOT.awk ingot.txt
, 0                    01, 3686.3
                     0.01, 3686.3, 3680.0

Gawk for Windows
C:\cygwin64\home\trading_scripts>gawk -f PROCESS_INGOT.awk ingot.txt
"SP", 2183197,"SELL, 0.01, 3686.3, 0
"SP", 2183197,"SELL, 0.01, 3686.3, 3680.0


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019