Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I want to delete all the words before a pattern for example: I want to delete all the words before STAC.
STAC
Input:
asd asdd asddd STACKSTAC asd as
Output:
STAC asd as
I have this code sed -ni "s/^.*STAC//d" myfile
sed -ni "s/^.*STAC//d" myfile
asd asdd asddd STACK asd as
asd asdd asddd STAC asd as
I want to delete all the words before a pattern, this is for example, i: I want to delete all the words before "STAC"STAC.
Input: asd asdd asddd STACK asd as Output:
Actually, iI have this code sed -ni "s/^.*STAC//d" myfile
Thanks
I want to delete all the words before a pattern, this is for example, i want to delete all the words before "STAC":
Input: asd asdd asddd STACK asd as Output: STAC asd as
Actually, i have this code sed -ni "s/^.*STAC//d" myfile