I have searched in a variety of ways in a variety of places but have come up empty.
I would like to prepend a portion of a section header to each following line until the next section header. I have been using sed for most things up until now but I'd go for a solution in just about anything-- awk, perl, python, tr, cat, you name it.
Thank you both. I have been banging my head against the wall on this one for literally weeks. I had a feeling it was terribly simple but I couldn't figure it out for the life of me.
Is there something I should have been searching for? I tried "prepend" "section" "header", etc etc but only came up with near misses.
I just meant that I probably could have found the solution you provided if I was searching for the correct terms, but I didn't know what I should be searching for. Kind of a chicken/egg thing I guess.
I was working on a different problem before and was having a heck of a time making any progress until I discovered that I wanted to do "tree traversal" at which point things got a lot easier. One of the perils of autodidactism I guess?