I'm looking at source files. For PureBasic actually, but whatever the language, there are common elements involved. In my case, the command would be cover extensions
find . -name "*.pb*" -exec grep -Hnr ... \;
The problem is, this can result in very long lines, and too contracted to read easily because they include
full/path/filename.ext:ln#:contents of that line.
I want to do one of two things: Either cut off the path completely (last
/ before first
:) and leave:
filename.ext:ln#:contents of that line
or split the line so that I have:
full/path/filename.ext: ln#:contents of that line
Either way makes the results more readable. You could even split it where you had:
full/path/filename.ext:ln#: contents of that line
for increased readability. I'm flexible. It can be any of these. It doesn't even have to be limited to a one-line command or these specific commands.
I've tried every technique I could find listed, involving
sed but I can't get the combo to do exactly what I want.