I'd like to replace extraneous data values (any value >100,000) of a csv with the previous non-extraneous value.
Input
1/1/2017 01:00 56242
1/1/2017 02:00 51214
1/1/2017 03:00 101442
1/1/2017 04:00 44242
1/1/2017 05:00 990919
1/1/2017 06:00 221512
1/1/2017 07:00 52100
Expected Output
1/1/2017 01:00 56242
1/1/2017 02:00 51214
1/1/2017 03:00 51214
1/1/2017 04:00 44242
1/1/2017 05:00 44242
1/1/2017 06:00 44242
1/1/2017 07:00 52100
Can this be done using awk in a bash script?
Something like:
awk 'BEGIN{FS=OFS=" "} NF{print $1, $2, ($3 >=100000 "not sure") output.csv
Any help would be appreciated - I'm not very familiar with awk.