DEV Community

Sinan Mujan for Wizard Health

Posted on

4 3

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.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay