Meza: Extract text from file
Sinan Mujan
Posted on January 16, 2020
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.
š šŖ š
š©
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.