You can also use the function bolp:
bolp is a built-in function in `../editfns.c'.
Return t if point is at the beginning of a line.
This function does
not change global state, including the match data.
Usually you get a buffer position via (point), thus simply issuing (bolp) will be enough. If the point has been moved, use goto-...
Try delete-duplicate-lines, which is part of distributed Emacs.
Emacs Wiki page Duplicate Lines might help.
It points to a blog post about it.
It explains why interactive search-and-replace might not help.
It explains how to do it with Lisp, in various ways.
It explains how to do it with the UNIX / GNU/Linux command sort or unique.
The minimum total height, in lines, of any window. The value has to
accommodate one text line, a mode and header line, a horizontal scroll
bar and a bottom divider, if present. A value less than
‘window-safe-min-height’ is ignored. The value of this variable is
honored when windows are resized or split.
I found this with M-x ...
Would it suit your purpose if you had a command which searched for the next line in the buffer which has a number in it and then showed you just that line?
(defun go-to-next-line-with-number ()
(when (search-forward-regexp "[0-9]" nil 0)
For a faster method to get line number at position -- (with-current-buffer BUFFER (goto-char POSITION) (string-to-number (format-mode-line "%l"))) -- see the following thread, which cites some limitations / disadvantages in the comments:
A faster method to obtain `line-number-at-pos` in large buffers
The traditional method is to use line-number-at-pos, ...
If you don't need to do this all the time, the quickest solution might be using interactive replacement: query-replace-regexp, bound to C-M-%. Start with point at the top of the buffer.
Note, if you want to delete entire lines, you'll need to include a newline in your regexp. You enter this at the prompt with C-q C-j.
So, for over_second, call C-M-%, then ...