1.The Greater Company :(Ranked 2) 5.United Taxi Service :(Ranked 3) 31.The Cacao Company :(Ranked 4) 40.Monster Inc. :(Ranked 5) 55.Afala, Industrial Strength :(Ranked 6) 60.The North Company :(Ranked 7)
I want to display just the company number and company name. I do not want the rest of the line to be displayed.
1.The Greater Company 5.United Taxi Service 31.The Cacao Company 40.Monster Inc. 55.Afala, Industrial Strength 60.The North Company
I can do this by sed 's/: .* //' filename.txt. How would I use this pattern with back reference so I can achieve the above result. The pattern that I want to match would be ([0-9]* .* :).