Basically I need what the OP of this question got but didn't want. How to delete everything after a certain pattern or a string in a file?
So I got the data like:
Something and something ........................... 23
Another one .......................................123
Somethingelse Inc. .................................243
So what I want is to delete the whole bunch of dots (and the numbers) after the space.
So far, I tried to use the OP's command there but it didn't quite work as I expected because it deletes everything after the first dot it encounters. Which means that the dot on the data of the sort Somethinelse Inc. is also deleted.
I tried to make the first (sed) answer from that question work by replacing the first .com with three dots and the second one with an empty space but I failed. This time everything after the first space is deleted or three dots left.
The second answer (ex -sc ...) worked like the OP wanted but it leaves some dots behind for me so I had no luck with it either.
I also tried to tweak the command from this answer but also failed at that. How can I delete everything until a pattern and everything after another pattern from a line?
sed 's/ \.\..*$//' /path/to/file
should work.sed
didn't work, I was expecting clarification as to what is didn't do properly. I'll copy it into an answer shortly.