在最大值之后计算特定范围内的行数

时间:2016-11-23 12:08:33

标签: awk grep

我有一个带有温度值的文本文件(加热和冷却),我想要在特定温度范围内(例如600-500°C)的线路数量,但仅在达到最高温度后(冷却) 。

    Time    PTemp   TC1 TC2 TC3
(sec)       (C) (C) (C)
0.00000 0.29228 19.98   20.465  20.272
0.01000 0.60268 20.015  20.461  20.272
0.02000 0.92608 19.918  20.486  20.247
0.03000 1.2507  19.871  20.492  20.343
0.04000 1.5754  19.864  20.415  20.238
0.05000 1.9 19.94   20.424  20.134
0.06000 2.2247  20.008  20.531  20.167
0.07000 2.5494  19.969  20.503  20.075
0.08000 2.8741  19.984  20.39   20.13
0.09000 3.1987  19.964  20.393  20.274
0.10000 3.5234  19.805  20.372  20.175
0.11000 3.8481  19.797  20.469  20.173
0.12000 4.1728  19.826  20.568  20.254
0.13000 4.4974  19.858  20.509  20.271
0.14000 4.8221  19.966  20.493  20.272
0.15000 5.1468  19.886  20.467  20.221
0.16000 5.4715  19.814  20.435  20.286
0.17000 5.7962  19.853  20.404  20.201
0.18000 6.1208  19.889  20.424  20.153
0.19000 6.4455  19.997  20.506  20.249
0.20000 6.7702  19.969  20.548  20.169
0.21000 7.0949  19.933  20.631  20.173
0.22000 7.4195  19.952  20.572  20.254
0.23000 7.7442  19.881  20.428  20.246
0.24000 8.0689  19.864  20.45   20.318
0.25000 8.3936  19.838  20.486  20.232
0.26000 8.7182  19.833  20.492  20.159
0.27000 9.0429  19.858  20.492  20.249
0.28000 9.3676  19.889  20.467  20.195
0.29000 9.6923  20.023  20.486  20.179
0.30000 10.017  20.051  20.441  20.178
0.31000 10.342  19.976  20.404  20.178
0.32000 10.666  19.959  20.5    20.203
0.33000 10.991  19.881  20.446  20.184
0.34000 11.316  19.788  20.481  20.204
0.35000 11.64   19.796  20.594  20.235
0.36000 11.965  19.928  20.591  20.215
0.37000 12.29   19.957  20.535  20.184
0.38000 12.614  19.856  20.396  20.204
0.39000 12.939  19.884  20.368  20.26
0.40000 13.264  19.92   20.469  20.323
0.41000 13.588  19.824  20.517  20.283
0.42000 13.913  19.853  20.549  20.196
0.43000 14.238  19.889  20.58   20.179
0.44000 14.562  19.869  20.509  20.152
0.45000 14.887  19.864  20.518  20.198
0.46000 15.212  19.864  20.472  20.26
0.47000 15.536  19.889  20.41   20.246
0.48000 15.861  19.895  20.475  20.215
0.49000 16.186  19.895  20.517  20.261
0.50000 16.51   19.87   20.472  20.246
0.51000 16.835  19.838  20.461  20.19
0.52000 17.16   19.781  20.563  20.127
0.53000 17.484  19.821  20.534  20.039
0.54000 17.809  19.934  20.473  20.098
0.55000 18.134  19.931  20.41   20.114
0.56000 18.458  19.876  20.347  20.141
0.57000 18.783  19.915  20.489  20.274
0.58000 19.108  20.003  20.522  20.277
0.59000 19.433  20.02   20.447  20.17
0.60000 19.757  20.021  20.456  20.122
0.61000 20.082  19.919  20.46   20.115
0.62000 20.407  19.871  20.512  20.243
0.63000 20.731  19.915  20.472  20.271
0.64000 21.056  20.079  20.461  20.272
0.65000 21.381  20.011  20.563  20.323
0.66000 21.705  20.169  20.279  20.36
0.67000 22.03   20.054  20.391  20.238
0.68000 22.355  20.61   20.121  20.517
0.69000 22.679  20.227  20.362  20.328
0.70000 23.004  20.554  20.222  20.556
0.71000 23.329  20.185  20.461  20.436
0.72000 23.653  20.65   20.393  20.757
0.73000 23.978  20.228  20.802  20.63
0.74000 24.303  20.676  20.769  20.972
0.75000 24.627  20.535  21.102  20.798
0.76000 24.952  20.687  21.078  20.822
0.77000 25.277  20.73   21.084  20.914
0.78000 25.601  20.987  21.217  21.314
0.79000 25.926  20.836  21.424  21.169
0.80000 26.251  21.304  21.515  21.455
0.81000 26.575  21.284  21.835  21.5
0.82000 26.9    21.516  21.877  21.779
0.83000 27.225  21.623  22.054  21.866
0.84000 27.549  21.918  22.195  22.053
0.85000 27.874  22.11   22.423  22.169
0.86000 28.199  22.448  22.648  22.469
0.87000 28.523  22.517  22.792  22.583
0.88000 28.848  22.852  23.02   22.878
0.89000 29.173  22.899  23.271  22.966
0.90000 29.497  23.331  23.471  23.28
0.91000 29.822  23.478  23.762  23.399
0.92000 30.147  23.569  23.948  23.643
0.93000 30.471  23.872  24.285  23.899
0.94000 30.796  24.365  24.558  24.253
0.95000 31.121  24.591  24.734  24.399
0.96000 31.446  24.876  25.096  24.725
0.97000 31.77   25.115  25.4    24.972
0.98000 32.095  25.46   25.735  25.296
0.99000 32.42   25.709  26.029  25.461
1.00000 32.744  25.979  26.21   25.742
1.01000 33.069  26.414  26.47   26.157
1.02000 33.394  26.728  26.829  26.339
1.03000 33.718  27.037  27.18   26.621
1.04000 34.043  27.449  27.5    26.88
1.05000 34.368  27.759  27.687  27.131
1.06000 34.692  27.989  28.049  27.506
1.07000 35.017  28.209  28.354  27.733
1.08000 35.342  28.604  28.612  28.073
1.09000 35.666  28.964  28.987  28.371
1.10000 35.991  29.231  29.266  28.652
1.11000 36.316  29.585  29.592  29.011
1.12000 36.64   30.008  29.936  29.433
1.13000 36.965  30.267  30.177  29.77
1.14000 37.29   30.689  30.551  30.082
1.15000 37.614  30.952  30.903  30.14
1.16000 37.939  31.248  31.146  30.394
1.17000 38.264  31.688  31.491  30.859
1.18000 38.588  31.977  31.84   31.128
1.19000 38.913  32.383  32.183  31.528
1.20000 39.238  32.716  32.502  31.911
1.21000 39.562  33.056  32.788  32.237
1.22000 39.887  33.498  33.224  32.599
1.23000 40.212  33.84   33.613  32.847
1.24000 40.536  34.177  33.888  33.091
1.25000 40.861  34.573  34.188  33.418
1.26000 41.186  34.851  34.475  33.709
1.27000 41.51   35.154  34.755  34.145
1.28000 41.835  35.515  35.165  34.585
1.29000 42.16   35.89   35.599  34.768
1.30000 42.484  36.289  35.962  34.996
1.31000 42.809  36.594  36.229  35.348
1.32000 43.134  36.824  36.529  35.67
1.33000 43.458  37.223  36.839  36.009
1.34000 43.783  37.707  37.174  36.427
1.35000 44.108  37.978  37.591  36.763
1.36000 44.433  38.223  37.924  37.1
1.37000 44.757  38.576  38.21   37.445
1.38000 45.082  38.972  38.59   37.762
1.39000 45.407  39.405  38.867  38.126
1.40000 45.731  39.762  39.166  38.398
1.41000 46.056  40.158  39.602  38.726
1.42000 46.381  40.484  39.966  38.991
1.43000 46.705  40.823  40.434  39.391
1.44000 47.03   41.112  40.753  39.774
1.45000 47.355  41.471  41.008  40.121
1.46000 47.679  41.916  41.383  40.413
1.47000 48.004  42.279  41.709  40.718
1.48000 48.329  42.593  42.147  41.154
1.49000 48.653  43.004  42.51   41.492
1.50000 48.978  43.385  42.676  41.803
1.51000 49.303  43.681  43.029  42.114
1.52000 49.627  43.984  43.43   42.422
1.53000 49.952  44.369  43.707  42.681
1.54000 50.277  44.719  44.133  43.028
1.55000 50.601  45.06   44.52   43.474
1.56000 50.926  45.499  44.868  43.836
1.57000 51.251  45.862  45.182  44.051
1.58000 51.575  46.152  45.517  44.312
1.59000 51.9    46.658  46.006  44.792
1.60000 52.225  46.91   46.329  45.089
1.61000 52.549  46.923  46.633  45.314
1.62000 52.874  47.569  47.019  45.93
1.63000 53.199  47.888  47.518  46.209
1.64000 53.523  48.183  47.741  46.323
1.65000 53.848  48.695  48.048  46.745
1.66000 54.173  49.072  48.438  47.06
1.67000 54.497  49.44   48.738  47.441
1.68000 54.822  49.684  49.119  47.791
1.69000 55.147  49.978  49.418  48.056
1.70000 55.471  50.435  49.824  48.503
1.71000 55.796  50.803  50.254  48.871
1.72000 56.121  51.018  50.562  49.086
1.73000 56.446  51.432  50.915  49.425
1.74000 56.77   51.792  51.311  49.793
1.75000 57.095  52.235  51.586  50.265
1.76000 57.42   52.671  51.962  50.632
1.77000 57.744  53.004  52.236  50.873
1.78000 58.069  53.338  52.483  51.19
1.79000 58.394  53.653  52.779  51.479
1.80000 58.718  53.987  53.161  51.732
1.81000 59.043  54.378  53.56   52.182
1.82000 59.368  54.578  53.86   52.448
1.83000 59.692  54.987  54.238  52.793
1.84000 60.017  55.445  54.612  53.262
1.85000 60.342  55.783  54.931  53.529
1.86000 60.666  56.117  55.264  53.797
1.87000 60.991  56.507  55.552  54.176
1.88000 61.316  56.881  55.93   54.45
1.89000 61.64   57.277  56.329  54.773
1.90000 61.965  57.502  56.603  55.06
1.91000 62.29   57.813  56.876  55.388
1.92000 62.614  58.149  57.202  55.625
1.93000 62.939  58.512  57.54   55.892
1.94000 63.264  58.929  57.878  56.293
1.95000 63.588  59.284  58.117  56.572
1.96000 63.913  59.597  58.458  56.895
1.97000 64.238  59.93   58.876  57.308
1.98000 64.562  60.267  59.156  57.537
1.99000 64.887  60.63   59.503  57.799
2.00000 65.212  60.997  59.822  58.15
2.01000 65.536  61.366  60.005  58.393
2.02000 65.861  61.709  60.385  58.708
2.03000 66.186  62.022  60.712  59.095
2.04000 66.51   62.379  61.145  59.444
2.05000 66.835  62.672  61.529  59.732
2.06000 67.16   62.999  61.724  59.984
2.07000 67.484  63.436  62.103  60.305
2.08000 67.809  63.721  62.481  60.641
2.09000 68.134  64.118  62.774  61.004
2.10000 68.458  64.546  63.152  61.272
2.11000 68.783  64.801  63.425  61.494
2.12000 69.108  65.117  63.672  61.933
2.13000 69.433  65.454  64.017  62.322
2.14000 69.757  65.816  64.31   62.592
2.15000 70.082  66.26   64.636  62.913
2.16000 70.407  66.42   64.924  63.051
2.17000 70.731  66.79   65.25   63.445
2.18000 71.056  67.242  65.637  63.927
2.19000 71.381  67.527  65.961  64.168
2.20000 71.705  67.924  66.369  64.504
2.21000 72.03   68.277  66.647  64.771
2.22000 72.355  68.64   66.87   64.968
2.23000 72.679  68.959  67.234  65.378
2.24000 73.004  69.042  67.532  65.636
2.25000 73.329  69.4    67.859  65.978
2.26000 73.653  69.851  68.22   66.419
2.27000 73.978  70.186  68.463  66.705
2.28000 74.303  70.594  68.878  67.026
2.29000 74.627  70.898  69.311  67.214
2.30000 74.952  71.225  69.615  67.418
2.31000 75.277  71.662  69.942  67.733
2.32000 75.601  71.922  70.179  67.994
2.33000 75.926  72.239  70.444  68.416
2.34000 76.251  72.7    70.819  68.824
2.35000 76.575  73.04   71.166  69.049
2.36000 76.9    73.273  71.503  69.284
2.37000 77.225  73.563  71.815  69.605
2.38000 77.549  73.968  72.197  70.016
2.39000 77.874  74.271  72.494  70.27
2.40000 78.199  74.648  72.771  70.536
2.41000 78.523  75.12   73.196  70.886
2.42000 78.848  75.46   73.53   71.178
2.43000 79.173  75.867  73.737  71.554
2.44000 79.497  76.145  74.047  71.777
2.45000 79.822  76.218  74.507  72.012
2.46000 80.147  76.649  74.747  72.456
2.47000 80.471  76.916  75.107  72.67
2.48000 80.796  77.208  75.454  73
2.49000 81.121  77.514  75.816  73.366
2.50000 81.445  77.945  76.184  73.683
2.51000 81.77   78.303  76.427  73.965
2.52000 82.095  78.691  76.767  74.341
2.53000 82.42   79.089  77.133  74.688
2.54000 82.744  79.337  77.451  74.827
2.55000 83.069  79.777  77.733  75.145
2.56000 83.394  80.141  78.034  75.41
2.57000 83.718  80.504  78.365  75.756
2.58000 84.043  80.822  78.652  76.098
2.59000 84.368  81.103  78.903  76.335
2.60000 84.692  81.579  79.348  76.7
2.61000 85.017  81.923  79.811  76.997
2.62000 85.342  82.156  79.997  77.224
2.63000 85.666  82.571  80.197  77.564
2.64000 85.991  82.929  80.56   77.88
2.65000 86.316  83.292  80.882  78.262
2.66000 86.64   83.609  81.239  78.56
2.67000 86.965  83.916  81.556  78.786
2.68000 87.29   84.272  81.888  79.051
2.69000 87.614  84.614  82.274  79.302
2.70000 87.939  84.927  82.597  79.572
2.71000 88.264  85.233  82.929  79.997
2.72000 88.588  85.49   83.291  80.255
2.73000 88.913  85.86   83.633  80.522
2.74000 89.238  86.182  83.896  80.847
2.75000 89.562  86.514  84.117  81.158
2.76000 89.887  86.902  84.481  81.465
2.77000 90.212  87.225  84.803  81.746
2.78000 90.536  87.508  85.085  82.072
2.79000 90.861  87.884  85.386  82.359
2.80000 91.186  88.157  85.618  82.56
2.81000 91.51   88.553  85.982  82.894
2.82000 91.835  88.932  86.354  83.211
2.83000 92.16   89.276  86.573  83.443
2.84000 92.484  89.715  86.882  83.757
2.85000 92.809  89.974  87.218  84.044
2.86000 93.134  90.117  87.53   84.32
2.87000 93.458  90.439  87.812  84.595
2.88000 93.783  90.932  88.138  84.921
2.89000 94.108  91.252  88.574  85.183
2.90000 94.433  91.556  88.783  85.429
2.91000 94.757  91.863  88.964  85.798
2.92000 95.082  92.295  89.372  86.195
2.93000 95.407  92.605  89.779  86.419
2.94000 95.731  92.883  90.128  86.53
2.95000 96.056  93.283  90.416  86.722
2.96000 96.381  93.663  90.717  87.085
2.97000 96.705  94.081  91.023  87.457
2.98000 97.03   94.336  91.255  87.725
2.99000 97.355  94.652  91.545  88.046
3.00000 97.679  94.989  91.926  88.358
3.01000 98.004  95.252  92.25   88.664
3.02000 98.329  95.674  92.507  89.02
3.03000 98.653  96.033  92.704  89.238
3.04000 98.978  96.322  93.013  89.498
3.05000 99.303  96.748  93.425  89.923
3.06000 99.627  97.082  93.779  90.182
3.07000 99.951  97.415  94.043  90.424
3.08000 99.997  97.678  94.388  90.72
3.09000 100 97.949  94.706  90.976
3.10000 100 98.226  94.989  91.022
3.11000 100 98.726  95.266  91.373
3.12000 100 98.652  95.542  91.275
3.13000 100 99.141  95.743  91.788
3.14000 100.86  99.304  95.978  92.057
3.15000 101.86  99.694  96.274  92.419
3.16000 103.72  100.5   96.53   93.167
3.17000 107.43  100.37  96.802  93.02
3.18000 112.62  102.22  97.302  95.064
3.19000 119.47  101.51  97.903  94.402
3.20000 127.55  103.65  98.341  96.204
3.21000 136.77  103.67  100.14  96.54
3.22000 147.78  106.41  101.25  98.445
3.23000 160.15  107.67  103.63  99.611
3.24000 173.15  111.27  105.43  101.99
3.25000 186.9   113.83  109.34  105.07
3.26000 200.86  117.92  112.25  108.26
3.27000 215.61  121.95  117.71  113.46
3.28000 230.46  127.14  121.91  118.33
3.29000 245.52  132.43  127.94  123.91
3.30000 260.6   138.75  133.28  129.58
3.31000 275.45  145.02  140.05  135.61
3.32000 290.19  152.34  146.52  142.22
3.33000 304.85  159.69  154.22  149.51
3.34000 319.17  167.74  161.41  156.63
3.35000 333.46  175.86  169.44  164.16
3.36000 347.45  184.61  177.8   172.27
3.37000 360.69  193.08  187.56  181.04
3.38000 373.86  203.03  195.74  189.19
3.39000 386.93  212.98  205.17  198.36
3.40000 399.17  223.09  214.89  207.46
3.41000 411.32  233.41  224.91  217.18
3.42000 423.47  244.06  234.96  226.62
3.43000 434.75  254.94  245.61  236.99
3.44000 445.25  265.69  255.96  246.42
3.45000 455.69  276.9   266.63  256.49
3.46000 466.12  288.19  277.96  267.11
3.47000 475.82  299.89  289.14  278.13
3.48000 485.02  311.42  300.44  288.5
3.49000 494.18  323.15  311.92  299.5
3.50000 503.33  334.71  323.55  310.4
3.51000 512.12  346.72  335 321.51
3.52000 519.84  358.51  346.67  331.98
3.53000 527.46  370.62  358.22  342.92
3.54000 535.07  382.34  369.98  353.69
3.55000 542.69  394.29  381.56  364.82
3.56000 549.82  405.93  393.37  375.44
3.57000 556.2   417.83  404.81  386.34
3.58000 562.49  429.34  416.35  397.04
3.59000 568.79  441.04  427.7   407.9
3.60000 575.09  452.42  439.12  418.24
3.61000 581.35  463.77  450.12  428.75
3.62000 586.5   474.54  461.12  438.84
3.63000 591.51  485.56  471.73  449.09
3.64000 596.51  495.9   482.31  458.68
3.65000 601.51  506.43  492.34  468.26
3.66000 606.51  516.29  502.43  477.61
3.67000 611.48  526.09  511.74  486.78
3.68000 615.38  535.25  521.05  495.43
3.69000 619.14  544.36  529.78  503.99
3.70000 622.89  552.78  538.5   512
3.71000 626.65  561.2   546.36  519.61
3.72000 630.4   568.72  554.4   526.94
3.73000 634.16  576.43  561.25  533.66
3.74000 637.63  583.45  568.7   540.62
3.75000 640.52  590.2   574.71  546.64
3.76000 643.36  596.3   581.21  552.63
3.77000 646.2   602.37  586.64  557.97
3.78000 649.04  607.6   592.32  563.34
3.79000 651.88  612.97  597.12  568.13
3.80000 654.71  617.82  602.26  573.01
3.81000 657.55  622.62  606.57  577.45
3.82000 659.73  626.84  611.17  581.81
3.83000 661.8   631.12  614.94  585.46
3.84000 663.87  634.83  619.24  589.45
3.85000 665.94  638.75  622.38  592.64
3.86000 668 642.01  625.9   595.81
3.87000 670.07  645.4   628.85  598.71
3.88000 672.13  648.32  631.98  601.63
3.89000 674.2   651.44  634.85  604.44
3.90000 675.78  654.13  637.84  607.17
3.91000 677.12  656.94  640.41  609.65
3.92000 678.43  659.41  643.04  612.01
3.93000 679.74  661.97  645.37  614.39
3.94000 681.06  664.04  647.73  616.54
3.95000 682.37  666.45  649.76  618.59
3.96000 683.68  668.33  651.86  620.46
3.97000 684.99  670.48  653.73  622.32
3.98000 686.31  672.26  655.64  623.96
3.99000 687.35  674.18  657.32  625.69
4.00000 688.16  675.72  659.12  627.41
4.01000 688.95  677.4   660.61  628.97
4.02000 689.74  678.75  662.1   630.24
4.03000 690.52  680.49  663.48  631.61
4.04000 691.31  681.59  664.91  632.72
4.05000 692.1   683.07  666.14  633.95
4.06000 692.89  684.3   667.37  635.16
4.07000 693.68  685.67  668.38  636.26
4.08000 694.47  686.7   669.64  637.12
4.09000 695.09  687.81  670.65  638.01
4.10000 695.47  688.62  671.64  638.89
4.11000 695.82  689.79  672.44  639.78
4.12000 696.18  690.39  673.24  640.36
4.13000 696.53  691.47  673.91  641.17
4.14000 696.89  692.15  674.74  641.75
4.15000 697.24  692.95  675.37  642.36
4.16000 697.6   693.5   676.09  642.87
4.17000 697.95  694.26  676.7   643.4
4.18000 698.31  694.68  677.22  643.69
4.19000 698.66  695.41  677.64  644.18
4.20000 698.98  695.83  678.06  644.5
4.21000 699.08  696.44  678.53  644.89
4.22000 699.16  696.71  678.89  645.12
4.23000 699.24  697.41  679 645.37
4.24000 699.32  697.58  679.51  645.37
4.25000 699.4   698.02  679.89  645.71
4.26000 699.48  698.26  680.17  645.83
4.27000 699.56  698.54  680.57  645.99
4.28000 699.64  698.55  680.79  645.92
4.29000 699.72  699.01  680.75  646.08
4.30000 699.8   699.43  680.98  646.19
4.31000 699.88  699.8   681.16  646.38
4.32000 699.96  699.65  681.39  646.29
4.33000 699.88  700.04  681.36  646.34
4.34000 699.68  700.02  681.47  646.11
4.35000 699.46  700.48  681.52  646.25
4.36000 699.25  700.27  681.87  646
4.37000 699.03  700.65  681.65  646.01
4.38000 698.82  700.2   682 645.8
4.39000 698.6   700.8   681.73  645.93
4.40000 698.38  700.51  681.89  645.67
4.41000 698.17  700.89  681.63  645.58
4.42000 697.95  700.71  681.73  645.3
4.43000 697.74  701.13  681.47  645.15
4.44000 697.52  701.1   681.6   645.05
4.45000 697.31  701.2   681.5   644.91
4.46000 697.09  701.28  681.37  644.76
4.47000 696.81  701.29  681.39  644.63
4.48000 696.49  701.29  681.38  644.42
4.49000 696.17  701.46  681.37  644.18
4.50000 695.85  701.45  681.32  643.94
4.51000 695.52  701.47  681.19  643.67
4.52000 695.2   701.65  681.04  643.55
4.53000 694.88  701.61  680.96  643.38
4.54000 694.55  701.57  681 643.13
4.55000 694.23  701.59  680.94  642.88
4.56000 693.91  701.62  680.82  642.69
4.57000 693.59  701.65  680.82  642.51
4.58000 693.26  701.7   680.71  642.23
4.59000 692.94  701.81  680.61  641.96
4.60000 692.62  701.89  680.59  641.79
4.61000 692.29  701.9   680.49  641.61
4.62000 691.95  701.9   680.39  641.38
4.63000 691.49  701.92  680.4   641.14
4.64000 691.03  701.9   680.28  640.85
4.65000 690.56  701.92  680.06  640.58
4.66000 690.1   701.95  679.97  640.28
4.67000 689.63  701.91  679.9   640.01
4.68000 689.17  701.9   679.89  639.88
4.69000 688.7   701.9   679.72  639.57
4.70000 688.24  701.97  679.53  639.21
4.71000 687.77  702.04  679.43  639.03
4.72000 687.31  701.97  679.29  638.75
4.73000 686.84  702.03  679.31  638.43
4.74000 686.38  702.1   679.24  638.1
4.75000 685.91  702.13  679.08  637.84
4.76000 685.45  702.19  679 637.67
4.77000 684.98  702.05  678.84  637.38
4.78000 684.52  701.95  678.68  637.07
4.79000 684.05  702 678.63  636.87
4.80000 683.53  701.94  678.55  636.54
4.81000 683.01  702 678.39  636.18
4.82000 682.49  702.02  678.25  635.8
4.83000 681.96  701.92  678.16  635.43
4.84000 681.44  702 678.02  635.17
4.85000 680.92  701.99  677.77  634.83
4.86000 680.39  701.91  677.57  634.55
4.87000 679.87  701.92  677.46  634.3
4.88000 679.35  701.83  677.27  633.89
4.89000 678.82  701.81  677.14  633.49
4.90000 678.3   701.81  676.97  633.12
4.91000 677.78  701.71  676.78  632.76
4.92000 677.25  701.81  676.73  632.48
4.93000 676.73  701.79  676.6   632.16
4.94000 676.21  701.7   676.4   631.92
4.95000 675.68  701.76  676.19  631.66
4.96000 675.16  701.7   675.95  631.25
4.97000 674.64  701.59  675.78  630.82
4.98000 674.11  701.61  675.7   630.55
4.99000 673.56  701.62  675.64  630.26
5.00000 672.99  701.6   675.41  629.89
5.01000 672.43  701.57  675.19  629.55
5.02000 671.86  701.47  675.08  629.05
5.03000 671.3   701.35  674.84  628.63
5.04000 670.73  701.3   674.69  628.38
5.05000 670.17  701.24  674.52  628.07
5.06000 669.6   701.16  674.34  627.72
5.07000 669.04  701.19  674.25  627.34
5.08000 668.47  701.08  674.05  626.95
5.09000 667.91  700.95  673.81  626.58
5.10000 667.34  700.88  673.64  626.17
5.11000 666.78  700.72  673.44  625.78
5.12000 666.21  700.69  673.27  625.44
5.13000 665.64  700.66  673.02  624.99
5.14000 665.08  700.56  672.78  624.61
5.15000 664.51  700.44  672.71  624.32
5.16000 663.95  700.27  672.51  623.88
5.17000 663.38  700.18  672.29  623.5
5.18000 662.82  700.17  672.08  623.16
5.19000 662.25  700.1   671.82  622.78
5.20000 661.7   700.03  671.6   622.39
5.21000 661.14  699.92  671.34  621.96
5.22000 660.59  699.85  671.19  621.58
5.23000 660.04  699.81  671.07  621.2
5.24000 659.49  699.66  670.75  620.73
5.25000 658.94  699.6   670.54  620.33
5.26000 658.39  699.52  670.26  619.91
5.27000 657.84  699.38  669.93  619.49
5.28000 657.29  699.23  669.7   619.05
5.29000 656.74  699 669.41  618.58
5.30000 656.18  698.98  669.26  618.22
5.31000 655.63  698.91  669.11  617.89
5.32000 655.08  698.68  668.89  617.46
5.33000 654.53  698.58  668.65  617.06
5.34000 653.98  698.52  668.36  616.65
5.35000 653.43  698.41  668.11  616.23
5.36000 652.88  698.26  667.96  615.76
5.37000 652.33  698.13  667.7   615.28
5.38000 651.78  698.06  667.42  615
5.39000 651.23  697.93  667.1   614.68
5.40000 650.67  697.75  666.74  614.23
5.41000 650.12  697.62  666.58  613.75
5.42000 649.57  697.5   666.28  613.25
5.43000 649.02  697.3   666 612.81
5.44000 648.45  697.16  665.78  612.42
5.45000 647.88  697.04  665.42  612.03
5.46000 647.3   696.92  665.18  611.69
5.47000 646.73  696.9   664.97  611.29
5.48000 646.16  696.73  664.56  610.77
5.49000 645.59  696.51  664.21  610.31
5.50000 645.02  696.5   663.95  609.93
5.51000 644.44  696.23  663.61  609.4
5.52000 643.87  696 663.35  608.93
5.53000 643.3   695.91  663.13  608.7
5.54000 642.73  695.63  662.75  608.37
5.55000 642.15  695.47  662.47  607.79
5.56000 641.58  695.4   662.25  607.22
5.57000 641.01  695.26  661.97  606.79
5.58000 640.44  695.06  661.72  606.43
5.59000 639.86  694.85  661.38  605.97
5.60000 639.29  694.61  661.12  605.52
5.61000 638.72  694.44  660.92  605.09
5.62000 638.15  694.32  660.59  604.63
5.63000 637.58  694.22  660.18  604.2
5.64000 637 694.03  659.91  603.75
5.65000 636.43  693.77  659.67  603.33
5.66000 635.86  693.62  659.4   602.98
5.67000 635.29  693.4   659.06  602.53
5.68000 634.71  693.16  658.72  602.08
5.69000 634.14  692.96  658.44  601.61
5.70000 633.61  692.71  658.12  601.15
5.71000 633.1   692.49  657.88  600.75
5.72000 632.58  692.22  657.55  600.24
5.73000 632.07  692.03  657.17  599.8
5.74000 631.55  691.89  656.87  599.41
5.75000 631.04  691.6   656.6   598.92
5.76000 630.52  691.36  656.33  598.41
5.77000 630.01  691.23  655.99  597.95
5.78000 629.49  691.03  655.58  597.6
5.79000 628.98  690.79  655.26  597.29
5.80000 628.46  690.58  654.9   596.78
5.81000 627.95  690.34  654.59  596.31
5.82000 627.43  690.1   654.29  595.88
5.83000 626.92  689.93  653.92  595.44
5.84000 626.4   689.73  653.67  595.11
5.85000 625.89  689.47  653.34  594.69
5.86000 625.37  689.17  653.03  594.24
5.87000 624.86  688.92  652.73  593.82
5.88000 624.34  688.72  652.28  593.4
5.89000 623.83  688.44  651.87  592.96
5.90000 623.31  688.16  651.53  592.39
5.91000 622.8   687.92  651.23  591.89
5.92000 622.28  687.75  651 591.53
5.93000 621.77  687.47  650.64  591.11
5.94000 621.25  687.17  650.23  590.64
5.95000 620.74  686.99  649.88  590.26
5.96000 620.22  686.77  649.47  589.77
5.97000 619.7   686.53  649.15  589.29
5.98000 619.19  686.24  648.8   588.96
5.99000 618.67  685.91  648.46  588.56
6.00000 618.14  685.7   648.16  588.1
6.01000 617.62  685.62  647.83  587.64
6.02000 617.09  685.36  647.38  587.15
6.03000 616.57  685.06  646.97  586.71
6.04000 616.04  684.8   646.66  586.37
6.05000 615.52  684.49  646.16  585.84
6.06000 614.99  684.23  645.77  585.37
6.07000 614.47  683.94  645.5   584.95
6.08000 613.94  683.59  645.21  584.51
6.09000 613.41  683.37  644.86  584.18
6.10000 612.89  683.04  644.5   583.69
6.11000 612.36  682.78  644.24  583.17
6.12000 611.84  682.64  643.85  582.76
6.13000 611.31  682.24  643.41  582.32
6.14000 610.79  681.92  643.03  581.9
6.15000 610.26  681.61  642.62  581.51
6.16000 609.74  681.26  642.22  581.07
6.17000 609.21  680.97  641.9   580.67
6.18000 608.69  680.75  641.6   580.21
6.19000 608.16  680.49  641.25  579.66
6.20000 607.64  680.12  640.87  579.22
6.21000 607.11  679.7   640.48  578.82
6.22000 606.59  679.43  640.09  578.46
6.23000 606.06  679.16  639.65  578.05
6.24000 605.53  678.84  639.3   577.58
6.25000 605.01  678.58  638.99  577.16
6.26000 604.48  678.19  638.57  576.74
6.27000 603.96  677.79  638.22  576.3
6.28000 603.43  677.47  637.82  575.75
6.29000 602.91  677.17  637.37  575.31
6.30000 602.38  676.94  637.04  574.94
6.31000 601.88  676.71  636.67  574.46
6.32000 601.43  676.37  636.26  574
6.33000 600.99  676.05  635.91  573.53
6.34000 600.54  675.75  635.55  573.12
6.35000 600.1   675.38  635.14  572.76
6.36000 599.65  674.96  634.8   572.28
6.37000 599.21  674.68  634.37  571.82
6.38000 598.76  674.44  633.99  571.52
6.39000 598.32  674.15  633.63  571.08
6.40000 597.87  673.82  633.27  570.65
6.41000 597.43  673.39  632.89  570.21
6.42000 596.98  673.01  632.43  569.64
6.43000 596.54  672.73  632.12  569.21
6.44000 596.09  672.43  631.75  568.78
6.45000 595.65  672.1   631.28  568.33
6.46000 595.2   671.77  630.93  567.95
6.47000 594.76  671.34  630.57  567.5
6.48000 594.31  670.94  630.14  567.09
6.49000 593.87  670.67  629.74  566.71
6.50000 593.42  670.43  629.32  566.22
6.51000 592.98  670.09  628.95  565.84
6.52000 592.53  669.78  628.62  565.48
6.53000 592.09  669.43  628.19  565
6.54000 591.64  669.11  627.69  564.56
6.55000 591.2   668.81  627.35  564.17
6.56000 590.75  668.27  626.95  563.71
6.57000 590.31  667.91  626.53  563.33
6.58000 589.86  667.66  626.16  562.92
6.59000 589.42  667.24  625.71  562.48
6.60000 588.97  666.91  625.32  562.03
6.61000 588.53  666.71  624.92  561.51

我有一个awk脚本,可以计算特定范围的行,但我不知道如何在达到最高温度后开始计数。

awk '$3<600 && $3>500 { count++ } END { print count/100 }' Tp700_5s_3TC.d02

任何人都可以帮助我吗?

2 个答案:

答案 0 :(得分:1)

我将在awk为此提供解决方案。

首先,您需要获取$3中最大值的行号,使用awk逻辑找到它并将其存储在bash变量中。我在命令行上运行此命令。在没有$ sigil的情况下运行相同的内容。

$ startLine=$(awk 'BEGIN {max = 0} {if ($3>max){ max=$3;lineNum=NR}} END {print lineNum}' file)
$ printf "%s\n" "$startLine" 
477

此处的最大值位于行477中,其值为702.19。因此,根据我的理解,您希望在500-600之间看到超出此点的波动。在awk中添加另一个逻辑。

$ awk -v startLine="$startLine" 'NR>startLine{if ($3<600 && $3>500){count++}}END { print count/100 }' file
0

由于您在行477之后的范围内没有任何其他行。在最后添加样本行时说

6.61000 588.53 566.71 624.92 561.51

该命令产生输出0.01,意味着在该范围内找到一个条目。

要在获取$3列中的最大数字时跳过标题行,请执行NR>1 即。

awk 'BEGIN {max = 0} NR>1{if ($3>max){ max=$3;lineNum=NR}} END {print lineNum}' file

答案 1 :(得分:1)

由于您还没有提供Minimal, Complete, and Verifiable example这是未经测试的,但一般的方法是每次找到比您之前的最高温度更高的温度时重置计数:

awk '
    NR==1 { next }
    ($3 > 500) && ($3 < 600) { cnt++ }
    (NR == 2) || ($3 > max) { max=$3; cnt=0 }
    END { print cnt }
' file