Extract text with sed

Published on December 21, 2017

sed, awk, regex

sed is useful for extracting data from file. Example below will output to screen any text (multiple lines supported), that is between words “START” and “END” in all markdown files in current directory.

sed '/```/,/```/!d;//d' *.md | tr -d '\n' | sed -E "s/,\s*/\n/g""