I have a text file with a list of quotes (example excerpt below). Some of the lines are header lines for the section of quotes following, which begin with 3 or more hyphens. I want an awk
script that selects a random non-header line, determines its header (the nearest line above it that starts with 3 or more hyphens), and then outputs the header and the line.
---- Characteristics of Innovative People ----
Iterate between abstract and concrete thinking.
Acknowledge the limits of your knowledge.
Step out of your comfort zone.