This question already has answers here:
Closed 3 years ago.
For e.g. I want to delete the second and the fourth word of each line
Before sample.txt:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nulla elit dui, fermentum sed quam sed, semper auctor elit.
After sample.txt:
Lorem dolor amet, consectetur adipiscing elit.
Nulla dui, sed quam sed, semper auctor elit.