How to navigate to a specific line of file in Bash?

There is a log. It is necessary to walk across the log and to compare the value of a piece of log with the value that was on it before.

With the help of awk and sed could not write (was not able to reconcile with the cycle and setting variables).
Please help
June 8th 19 at 17:22
1 answer
June 8th 19 at 17:24
Too vague formulated question.
Can current suggest that it is necessary to find the lines in the log where we need the parameter has changed relative to the previous one, for example:
L="дело1 this morning
дело2 this morning
дело3 was the day
дело4 was the day
дело5 was the day
дело6 was in the evening
дело7 was in the evening
дело8 was the night"

for example, a log file L and need to find rows where the third parameter has changed:
echo $L | awk 'BEGIN {k=""} {if (k!=$3){print $0}} {k=$3}'

you can even simplify writing:
echo $L | awk 'k!=$3 {print; k=$3}'

prints:
дело1 this morning
дело3 was the day
дело6 was in the evening
дело8 was the night

Find more questions by tags Linuxbash