3 ms·
You can use regex ranges to match every line between two regexes: https://www.gnu.org/software/gawk/manual/html_node/Ranges.html https://www.gnu.org/software/ga
by bcbrown 8y ago
You can use regex ranges to match every line between two regexes: https://www.gnu.org/software/gawk/manual/html_node/Ranges.html https://www.gnu.org/software/gawk/manual/html_node/Ranges.ht...
Another option might be to use multi-line records (https://www.gnu.org/software/gawk/manual/html_node/Multiple-Line.html https://www.gnu.org/software/gawk/manual/html_node/Multiple-...). First pre-process the file to add an empty line before each header, then use blank lines as the record separator and newlines for the field separator.