Meza: Extract text from file

sinanmujan

Sinan Mujan

Posted on January 16, 2020

Meza: Extract text from file

If you ever have a situation where you have a huge file and want to extract a certain portion from this file (e.g. a log file or database dump), you can use the sed command.

Sed is a stream editor that is used to perform basic text transformations on a file or input stream.

šŸ‘‡

Extract between two patterns (or words):

sed -n '/beginning_pattern/,/end_pattern/p'

Extract from a pattern (word) to the end of the file:

sed -n '/beginning_pattern/,$p'

For more information about sed, check out this link.

šŸ’– šŸ’Ŗ šŸ™… šŸš©
sinanmujan
Sinan Mujan

Posted on January 16, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Meza: Extract text from file
linux Meza: Extract text from file

January 16, 2020