oldfart007
Technical User
- May 8, 2025
- 1
working on a script to show internet data used by my router. The snmp data is placed in a text file every day once an hour.
I can't get rid of the first line 372.963 or the last line -407.11 . These are totally messing up my display
here is one of the data files 08-May-25-wrls0ta.txt
372963176
375429610
377839519
380349356
382724138
385122436
392181488
397911741
400312606
404918306
407109524
awk 'FNR==NR { print ($1 - prev)/1000000 } { prev = $1 }' 08-May-25-wrls0ta.txt
The output
372.963
2.46643
2.40991
2.50984
2.37478
2.3983
7.05905
5.73025
2.40087
4.6057
2.19122
-407.11
I can't get rid of the first line 372.963 or the last line -407.11 . These are totally messing up my display
here is one of the data files 08-May-25-wrls0ta.txt
372963176
375429610
377839519
380349356
382724138
385122436
392181488
397911741
400312606
404918306
407109524
awk 'FNR==NR { print ($1 - prev)/1000000 } { prev = $1 }' 08-May-25-wrls0ta.txt
The output
372.963
2.46643
2.40991
2.50984
2.37478
2.3983
7.05905
5.73025
2.40087
4.6057
2.19122
-407.11