public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Previously-functional gawk script now failing to execute - PLEASE HELP!!!
@ 2021-09-15 23:01 Bryan VanSchouwen
  2021-09-15 23:49 ` Lee
  0 siblings, 1 reply; 6+ messages in thread
From: Bryan VanSchouwen @ 2021-09-15 23:01 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 869 bytes --]

Hello.

I just tried executing an old, previously-functional awk script using a
version of gawk that I had downloaded last year, and a command of the
following format (as recommended in a previous communication with the
Cygwin mailing list):
gawk -vRS="\r\n" -f data_collect_e_-_FF_4-state.awk
but this time, the script failed to execute!!

Upon closer examination, the script appears to be failing after
successfully reading the first line of data from the input data file, even
though the input file has NOT been modified since it was last used.  (I
should point out that while the files were copied over from my old
computer, another awk script execution that I had attempted recently with
older files worked fine!)

(For reference, I have attached copies of the script and input files.)

What the heck is going on with this software, and is there a way to fix it?!

[-- Attachment #2: rpcg_FF_filtrd.txt --]
[-- Type: text/plain, Size: 2666 bytes --]

224 0.595851431 0.09369783
225 0.889062608 0.033480286
226 0.835640914 0.024667245
228 0.926425963 0.100830335
229 1.647598528 0.053075286
230 1.342667163 0.049740591
231 1.23487811 0.303661798
232 0.918372444 0.201229278
233 1.073620187 0.038863171
234 1.282736478 0.092083566
237 1.198194998 0.061451225
238 1.517388582 0.183405758
239 0.777250185 0.042951855
240 1.442106405 0.071534566
242 1.127683833 0.180393161
243 0.75826546 0.10362625
244 0.806582369 0.053810549
245 0.782472863 0.089712654
246 0.7665594 0.063004719
247 1.133027476 0.116433654
248 0.228653463 0.054674445
250 1.03832007 0.057555951
251 0.207643515 0.045497989
252 0.89097942 0.065711892
253 1.382205043 0.041019712
254 1.624161735 0.097996896
255 0.102011133 0.017824426
257 0.243916847 0.030898216
258 1.401842211 0.167043419
259 1.367403732 0.089365097
260 1.011543148 0.241393784
261 0.331122492 0.084430871
262 1.247481409 0.012064997
263 0.164144595 0.015874666
264 0.29124209 0.023159954
265 1.155980147 0.007664518
267 1.327231572 0.088667225
269 1.630417096 0.091432252
272 0.837876582 0.088357396
276 0.126347248 0.021352854
278 0.281248041 0.04460507
279 1.507370692 0.055864662
280 0.099307529 0.023337928
282 0.078283134 0.015679097
285 1.396978738 0.041014414
286 1.639489181 0.021233884
287 1.358795349 0.166693354
290 1.034468946 0.071941536
291 1.042912979 0.161347016
292 1.243638613 0.186114384
294 1.465291389 0.080129079
295 1.498983157 0.261019123
297 1.020960822 0.039127181
298 1.014076358 0.055905146
299 0.10474365 0.025701761
300 1.164509327 0.06490821
301 1.581053193 0.117554464
302 1.198070393 0.279390802
304 1.030638676 0.098787267
306 1.892887325 0.148397402
307 1.180718504 0.269259715
308 1.250687158 0.220505404
309 1.389652687 0.061317639
310 1.071337559 0.071155291
311 0.655741784 0.083834781
312 0.757954775 0.06606795
315 1.861485087 0.302438971
316 1.543650517 0.131453064
317 0.590790541 0.17252546
318 1.360237347 0.017090096
319 0.092471202 0.03160355
322 0.160293668 0.018528699
323 1.498177719 0.063140897
324 1.33747325 0.077138118
325 1.135054625 0.14033561
326 0.106286087 0.010054509
327 0.172350731 0.062090642
332 1.599736857 0.07364121
333 0.719466407 0.104815196
334 0.95050495 0.042289463
335 0.950136142 0.102065088
337 0.930073299 0.164582827
338 0.931813131 0.083700864
339 0.797003512 0.019929439
340 0.948011214 0.025551098
341 1.158923159 0.115968704
342 1.151928768 0.090588751
343 1.558238511 0.070125811
345 1.78478822 0.203931487
346 1.184805052 0.015907815
347 0.918694163 0.016359047
348 0.334625526 0.081083201
349 1.330240541 0.108204132
350 1.23117168 0.128820577
353 0.822391221 0.060853522
354 0.84578441 0.133596858

[-- Attachment #3: data_collect_e_-_FF_4-state.awk --]
[-- Type: application/octet-stream, Size: 2078 bytes --]

BEGIN { a = 0.2 ;  b = 1

	i = 1
	cuv = 0
	cuv2 = 0
	ifn = "rpcg_FF_filtrd.txt"
	while ( getline x < ifn > 0 )
		{ split(x, s, " ")
		  rpFF[s["1"]] = s["2"]
		  rpFFe[s["1"]] = s["3"]
		  i = i + 1
		  cuv = cuv + s["2"]
		  cuv2 = cuv2 + (s["2"]*s["2"])
		   }
	close(ifn)
	ave = cuv / i
	rpave = ave
#        print(s["1"], s["2"], ave, cuv2/i, i)
	rpsd = sqrt( (cuv2/i) - (ave*ave) )

	i = 1
	cuv = 0
	cuv2 = 0
	ifn = "spcg_FF_filtrd.txt"
	while ( getline x < ifn > 0 )
		{ split(x, s, " ")
		  spFF[s["1"]] = s["2"]
		  spFFe[s["1"]] = s["3"]
		  i = i + 1
		  cuv = cuv + s["2"]
		  cuv2 = cuv2 + (s["2"] * s["2"])
		  }
	close(ifn)
	ave = cuv / i
	spave = ave
	spsd = sqrt( (cuv2/i) - (ave*ave) )

	i = 1
	cuv = 0
	cuv2 = 0
	ifn = "cg_FF_filtrd.txt"
	while ( getline x < ifn > 0 )
		{ split(x, s, " ")
		  caFF[s["1"]] = s["2"]
		  caFFe[s["1"]] = s["3"]
		  i = i + 1
		  cuv = cuv + s["2"]
		  cuv2 = cuv2 + (s["2"] * s["2"])
		  }
	close(ifn)
	ave = cuv / i
	caave = ave
	casd = sqrt( (cuv2/i) - (ave*ave) )

	i = 1
	cuv = 0
	cuv2 = 0
	ifn = "ap_FF_filtrd.txt"
	while ( getline x < ifn > 0 )
		{ split(x, s, " ")
		  apFF[s["1"]] = s["2"]
		  apFFe[s["1"]] = s["3"]
		  i = i + 1
		  cuv = cuv + s["2"]
		  cuv2 = cuv2 + (s["2"] * s["2"])
		  }
	close(ifn)
	ave = cuv / i
	apave = ave
	apsd = sqrt( (cuv2/i) - (ave*ave) )


	i = 219
	while( i < 369 )
		{ i = i + 1
		  rp = rpFF[i]
		  rpe = rpFFe[i]
		  sp = spFF[i]
		  spe = spFFe[i]
		  ca = caFF[i]
		  cae = caFFe[i]
		  ap = apFF[i]
		  ape = apFFe[i]
		  ck = 1
# 		  if ( ap == 0 || rp == 0 || sp == 0 || ca == 0 || tm == 0 ||  i == 280 ) { ck = 0 }
 	  if ( ap == 0 || rp == 0 || sp == 0 || ca == 0 ) { ck = 0 }



	ck3 = 0
	if ( ck == 1 ) { ck3 = 1 }

          	    if ( ck3 == 1 ) { print(i) > "rn" }
	            if ( ck3 == 1 ) { print(i, ap, rp, ca, sp) > "idm.txt" }
	            if ( ck3 == 1 ) { print(ape, rpe, cae, spe) > "dme" }
	            if ( ck3 == 1 ) { print(ap, rp, ca, sp) > "dm" }}}  




[-- Attachment #4: spcg_FF_filtrd.txt --]
[-- Type: text/plain, Size: 2419 bytes --]

224 0.509749968 0.177160603
225 0.558302662 0.133600275
226 0.691840552 0.051067741
227 1.233597604 0.283456681
228 0.421856797 0.148593149
229 0.718569048 0.172281526
230 0.873414173 0.141360943
232 0.814583694 0.116116109
233 0.545530204 0.10546754
234 0.99700609 0.169893273
237 1.147039778 0.248435675
238 1.212524735 0.136625425
239 0.815957312 0.154361412
240 1.002183096 0.097622672
242 0.685532137 0.195614404
243 0.690542903 0.177536237
244 1.067802596 0.299976054
245 0.611368407 0.087569393
246 1.294782866 0.320160689
247 1.355992615 0.162978753
249 0.992940868 0.202092716
250 0.837372727 0.104691616
251 0.545193505 0.129523309
252 0.751120079 0.141558128
258 1.596453745 0.293675409
259 0.790301838 0.126762602
260 0.968986106 0.098652785
261 0.842054028 0.073642471
262 1.152477734 0.101408622
265 1.139992142 0.098671518
266 1.338325639 0.216312478
267 1.463659157 0.236418172
268 0.927751272 0.123255266
270 0.86399925 0.138745433
272 0.520219938 0.170853123
278 0.704652944 0.09522493
279 1.890656381 0.499643642
280 0.398963117 0.118476991
284 0.122517329 0.049364492
285 1.134970966 0.106429413
286 1.176698565 0.201348106
287 1.07703454 0.157882271
288 0.969053608 0.147946755
290 0.634496025 0.186587724
291 0.990315215 0.116076617
294 1.315796916 0.222188321
295 1.241466428 0.161521586
296 1.060798921 0.087565525
297 1.331018926 0.110648457
298 1.213718667 0.335101144
300 1.074262269 0.254162847
301 1.143427027 0.235296492
302 1.856459403 0.534523265
304 1.08032969 0.133033201
307 0.976015721 0.176975614
308 0.687689122 0.100853859
309 1.331519084 0.385045172
310 0.970342371 0.177311507
311 0.774552621 0.109466317
312 0.396517716 0.167415793
316 1.202523209 0.216192678
317 0.946846538 0.150835755
318 0.699703704 0.101802326
323 0.905277346 0.326510369
324 1.079279617 0.16164283
325 1.570931583 0.297582675
333 0.994707947 0.138947451
336 0.926256228 0.168399912
337 0.919221477 0.127753164
338 0.931101767 0.141549
339 0.68510803 0.12264392
340 0.659624385 0.122989609
341 0.766379335 0.163264906
342 1.252480933 0.355207025
343 0.82414255 0.110075779
345 1.079383935 0.20865452
346 0.658451474 0.055074645
347 0.915912467 0.126077488
348 0.676954521 0.171624556
350 0.783118294 0.213711949
353 0.376404717 0.165903535
354 0.62141219 0.14436852
355 0.987600057 0.341538663
360 0.749350015 0.07051748
362 0.646082377 0.153337997
365 0.917720204 0.167698889
366 0.771793534 0.198271795

[-- Attachment #5: cg_FF_filtrd.txt --]
[-- Type: text/plain, Size: 2132 bytes --]

226 0.843066831 0.049529738
227 0.954108467 0.125725748
229 1.390508469 0.104651927
230 1.285119866 0.116904342
233 0.911969637 0.096324741
234 1.341937337 0.115577627
237 1.316482912 0.128134695
238 0.966528304 0.173925363
240 1.212496274 0.10343495
244 1.002551653 0.13681438
245 1.311561914 0.139197673
246 1.252078759 0.09840253
247 1.474927975 0.056752454
248 0.127727313 0.02011639
249 0.78138777 0.033785997
250 1.166184024 0.057343098
251 1.013454362 0.130193187
252 1.195303646 0.055932031
254 1.279412083 0.046893714
255 0.18859384 0.060421222
257 0.31508091 0.039875362
258 1.708060159 0.120289606
259 1.780586998 0.261022902
260 1.402585068 0.118563102
261 0.995826505 0.169596348
262 1.228200003 0.06427328
265 1.384971485 0.255490559
266 0.9007042 0.187830524
267 0.994674935 0.269071907
268 1.059744138 0.070988177
269 0.75037625 0.084452981
270 1.330546402 0.03567043
272 0.673129305 0.06982645
274 0.14978026 0.061797795
278 0.481677204 0.129003212
279 1.261984124 0.117188451
280 0.665817328 0.120856588
281 0.16399412 0.025295917
286 1.010245308 0.023970618
294 1.490622241 0.111122037
295 1.211190566 0.055061951
296 0.953615142 0.05511918
297 0.73758346 0.062219359
298 1.353588416 0.200730463
299 0.146556067 0.011106832
300 1.117639993 0.128645377
301 1.666398755 0.090990434
302 1.510840403 0.324966017
304 0.991391266 0.072452474
306 0.88753303 0.220801807
307 0.956503374 0.057604407
308 1.10976997 0.13359723
309 0.949986813 0.061993134
310 1.361459145 0.168641903
311 1.29583609 0.110899336
315 1.340552138 0.107770761
317 1.032616356 0.086673031
318 0.823908453 0.224952502
320 0.192006416 0.077659952
321 0.192413763 0.058025889
323 1.807745401 0.256508021
324 1.204337976 0.021711216
325 1.401889355 0.05848541
326 0.215703517 0.041718858
327 0.259603455 0.061187344
328 0.33705019 0.088373193
329 0.107007782 0.038245511
332 1.319607871 0.155646029
333 1.497881703 0.182488244
335 1.63674359 0.143168527
336 0.865176127 0.156756394
337 0.796768449 0.082105434
339 1.095187434 0.097253843
340 0.739063539 0.098089054
341 0.969918499 0.132813782
343 1.217727054 0.081200055
366 1.168362381 0.156487497

[-- Attachment #6: ap_FF_filtrd.txt --]
[-- Type: text/plain, Size: 1803 bytes --]

230 1.25974524 0.07026373
232 1.083119236 0.065300659
234 1.192523205 0.028461905
237 1.912625889 0.305184635
238 1.61490719 0.119169357
240 1.067154737 0.067561357
244 0.901174097 0.01258941
246 1.118784224 0.251186199
247 0.936794319 0.111593713
248 0.866704533 0.135022267
249 1.824647703 0.145173714
250 1.121940808 0.105988665
251 1.130664313 0.101935438
252 1.155512521 0.069599369
253 1.731326964 0.075934031
255 0.262323282 0.061422677
256 1.010671526 0.142808549
257 0.49681467 0.089636039
258 1.774867708 0.20898153
259 1.692071675 0.075144162
260 1.324902308 0.044832439
261 0.758816248 0.092608941
262 1.593454971 0.050911366
265 1.560013286 0.26731331
266 1.600425852 0.05071501
268 1.117374864 0.033794213
273 1.247497932 0.053766497
274 0.383113699 0.037088989
275 0.151442226 0.029492811
276 0.108256474 0.016784264
277 0.133458228 0.02838235
278 0.84253204 0.071989291
279 1.20310256 0.033147564
280 0.78176368 0.094925665
283 1.10918377 0.227590723
285 1.074300671 0.09836378
286 1.241993868 0.072119316
292 1.309648411 0.041151278
294 1.624152414 0.184161653
296 1.493922117 0.059352808
299 1.546879603 0.130103974
300 0.931753471 0.126739447
301 1.172491396 0.062971321
302 1.286641196 0.080380425
303 1.273914789 0.056250758
304 1.395261409 0.141902322
305 1.77861029 0.177780737
307 0.747296675 0.059545517
311 0.842073037 0.256801983
318 1.066581207 0.075549445
319 1.629120019 0.064928327
320 1.673216307 0.048981444
321 0.590326337 0.07665652
322 0.632974882 0.129882182
323 1.895596674 0.166400392
324 1.293713902 0.032745603
325 1.874342089 0.067795737
327 0.399969104 0.122775859
329 0.230251027 0.093738437
330 0.297186864 0.077485609
334 1.440808158 0.033306564
335 0.68430652 0.135520986
337 1.757942877 0.224446146
339 1.399075953 0.130188707
340 0.887644185 0.032459021

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Previously-functional gawk script now failing to execute - PLEASE HELP!!!
  2021-09-15 23:01 Previously-functional gawk script now failing to execute - PLEASE HELP!!! Bryan VanSchouwen
@ 2021-09-15 23:49 ` Lee
  0 siblings, 0 replies; 6+ messages in thread
From: Lee @ 2021-09-15 23:49 UTC (permalink / raw)
  To: Bryan VanSchouwen; +Cc: cygwin

On 9/15/21, Bryan VanSchouwen via Cygwin wrote:
> Hello.
>
> I just tried executing an old, previously-functional awk script using a
> version of gawk that I had downloaded last year, and a command of the
> following format (as recommended in a previous communication with the
> Cygwin mailing list):
> gawk -vRS="\r\n" -f data_collect_e_-_FF_4-state.awk
> but this time, the script failed to execute!!

The data file you attached doesn't have "\r\n" line endings:
$ file rpcg_FF_filtrd.txt
rpcg_FF_filtrd.txt: ASCII text

compare with one that does:
$ file test.txt
test.txt: ASCII text, with CRLF line terminators

<.. snip ..>
> What the heck is going on with this software, and is there a way to fix
> it?!

I don't use RS and start my awk scripts off with
  sub("\r$", "", $0)  # fix any \r\n line endings
so my scripts work with either flavor of line endings.

If you don't want to change your script try changing your input
  unix2dos <your text files>

Regards,
Lee

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Previously-functional gawk script now failing to execute - PLEASE HELP!!!
  2021-09-15 21:11 Bryan VanSchouwen
  2021-09-15 21:33 ` Bill Stewart
  2021-09-15 21:43 ` Eliot Moss
@ 2021-09-16  1:58 ` Brian Inglis
  2 siblings, 0 replies; 6+ messages in thread
From: Brian Inglis @ 2021-09-16  1:58 UTC (permalink / raw)
  To: cygwin

On 2021-09-15 15:11, Bryan VanSchouwen via Cygwin wrote:
> I just tried executing an old, previously-functional awk script using a
> version of gawk that I had downloaded last year, and a command of the
> following format (as recommended in a previous communication with the
> Cygwin mailing list):
> gawk -vRS="\r\n" -f data_collect_e_-_FF_4-state.awk
> but this time, the script failed to execute!!
> 
> Upon closer examination, the script appears to be failing after
> successfully reading the first line of data from the input data file, even
> though the input file has NOT been modified since it was last used.  (I
> should point out that while the files were copied over from my old
> computer, another awk script execution that I had attempted recently with
> older files worked fine!)

So the script is not failing to execute, it is successfully reading the 
first line: so how is it failing, and what has that to do with the input 
file being modified, and if the input file has not been modified since 
the script was last used, why are you rerunning it?

Package gawk has been updated once a year for the last 4 years, up until 
2020-04, and has not changed recently, so the problem may be with your 
data file, or the script, or your Cygwin installation, and only you can 
really answer that, as they have been "copied" from another computer: 
using what process? How was Cygwin setup on the new computer, and which 
version of gawk was installed to be used?

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Previously-functional gawk script now failing to execute - PLEASE HELP!!!
  2021-09-15 21:11 Bryan VanSchouwen
  2021-09-15 21:33 ` Bill Stewart
@ 2021-09-15 21:43 ` Eliot Moss
  2021-09-16  1:58 ` Brian Inglis
  2 siblings, 0 replies; 6+ messages in thread
From: Eliot Moss @ 2021-09-15 21:43 UTC (permalink / raw)
  To: Bryan VanSchouwen, cygwin

On 9/15/2021 5:11 PM, Bryan VanSchouwen via Cygwin wrote:
> Hello.
> 
> I just tried executing an old, previously-functional awk script using a
> version of gawk that I had downloaded last year, and a command of the
> following format (as recommended in a previous communication with the
> Cygwin mailing list):
> gawk -vRS="\r\n" -f data_collect_e_-_FF_4-state.awk
> but this time, the script failed to execute!!
> 
> Upon closer examination, the script appears to be failing after
> successfully reading the first line of data from the input data file, even
> though the input file has NOT been modified since it was last used.  (I
> should point out that while the files were copied over from my old
> computer, another awk script execution that I had attempted recently with
> older files worked fine!)

Ignoring the shouting :-) ...

That command line assumes that the program will see \r\n
at the end of each line of input.  That is indeed the usual
line ending on Windows.  However!  Since it is not the usual
line ending on Posix (what Cygwin aims to be like), there
are various options/flags that can affect an internal
translation that effectively changes \r\n to \n, or
something like that.

Others will be able to supply the details more readily
than I, but I would look at the environment variable and
startup options to Cygwin around this point and see where
that leads you.

Regards - Eliot Moss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Previously-functional gawk script now failing to execute - PLEASE HELP!!!
  2021-09-15 21:11 Bryan VanSchouwen
@ 2021-09-15 21:33 ` Bill Stewart
  2021-09-15 21:43 ` Eliot Moss
  2021-09-16  1:58 ` Brian Inglis
  2 siblings, 0 replies; 6+ messages in thread
From: Bill Stewart @ 2021-09-15 21:33 UTC (permalink / raw)
  To: cygwin

On Wed, Sep 15, 2021 at 3:11 PM Bryan VanSchouwen wrote:

WHAT THE HECK IS GOING ON WITH THIS SOFTWARE?!
>

 I don't know what the technical problem is, but I would politely point out:

1. Typing things in all caps is considered shouting

2. Shouting at the people who might be able to help you is probably not the
best way to get help (to put it mildly)

3. Remember that the people who might be able to help you do so on a
volunteer basis (also, see #2 above)

You may be frustrated, but you're not doing yourself any favors by being
rude.

Bill

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Previously-functional gawk script now failing to execute - PLEASE HELP!!!
@ 2021-09-15 21:11 Bryan VanSchouwen
  2021-09-15 21:33 ` Bill Stewart
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bryan VanSchouwen @ 2021-09-15 21:11 UTC (permalink / raw)
  To: cygwin

Hello.

I just tried executing an old, previously-functional awk script using a
version of gawk that I had downloaded last year, and a command of the
following format (as recommended in a previous communication with the
Cygwin mailing list):
gawk -vRS="\r\n" -f data_collect_e_-_FF_4-state.awk
but this time, the script failed to execute!!

Upon closer examination, the script appears to be failing after
successfully reading the first line of data from the input data file, even
though the input file has NOT been modified since it was last used.  (I
should point out that while the files were copied over from my old
computer, another awk script execution that I had attempted recently with
older files worked fine!)

WHAT THE HECK IS GOING ON WITH THIS SOFTWARE?!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-16  1:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 23:01 Previously-functional gawk script now failing to execute - PLEASE HELP!!! Bryan VanSchouwen
2021-09-15 23:49 ` Lee
  -- strict thread matches above, loose matches on Subject: below --
2021-09-15 21:11 Bryan VanSchouwen
2021-09-15 21:33 ` Bill Stewart
2021-09-15 21:43 ` Eliot Moss
2021-09-16  1:58 ` Brian Inglis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).