what command with perl would allow me to count lines? in the output file should be at the start of the line how many times the contiguous lines appeared in a previous sorted file used as input.
input example :
line 1
line 2
line 2
line 2
line 3
line 3
line 3
ouput:
1= line 1
3= line 2
3= line 3
In a perl one-liner:
If you'd like to stream the results for a sorted file so that it stays in order and isn't loaded entirely into memory: