I am trying to search for consecutive, repeated instances of numbers in a file, with each number on a different line. It's easiest to show what I mean in an example.
For example, my input would be:
16
16
8
8
16
16
4
8
8
8
And my output would be:
16 2
8 2
16 2
4 1
8 3
This may appear to be a duplicate, but though I have found many solutions (like this one) for finding the repetitions of a single character, none of them are able to search for multiple repeated characters.
111), repeated strings (e.g.123123) or repeated lines? Will each line of your input only consist of a string of characters (including numbers) and no spaces? Do you just want repeated lines?