I have a file filled with numbers, number per line. Each number consists of two or three digits.
I would like to filter out this file by any number has two or more sequential digits. These sequential digits can be consecutive (e.g. 127, 215, 781), or non-consecutive (e.g. 506). The order of the sequential digits is not important. It can be small to large (e.g. 127) or large to small (e.g. 215).
For example:
127
215
781
874
370
01
10
142
506
94
The expected output:
370
94
Because:
127 # Has two sequential and consecutive digits (1 and 2)
215 # Has two sequential and consecutive digits (1 and 2)
781 # Has two sequential and consecutive digits (7 and 8)
874 # Has two sequential and consecutive digits (7 and 8)
370 # Keep
01 # Has two sequential and consecutive digits (0 and 1)
10 # Has two sequential and consecutive digits (0 and 1)
142 # Has two sequential and non-consecutive digits (1 and 2)
506 # Has two sequential and non-consecutive digits (5 and 6)
94 # Keep