I have a bunch of legacy html files where the the title is only stored in <title>
metadata. I need to add a line in body with the metadata <title>
as an <h1>
. For example, extract what's in the <title>{COPY-THIS}</title>
from the title and then add a new line at the beginning of the body with <h1>{COPY-THIS}</h1>
.
I think I need to use a regex to find what's in the title but not really sure how to do the bulk manipulation or even what code might work best for this conversion.
I'm on Mac or Linux. What is a method to copy what's in the title of each file and add a new line in bulk?
title-extracted
. So what you guys recommend is using an html parser instead? So maybe my question should be how to parse html to extract text from title and add additional html markup at the top of the body? – markwk Mar 17 '18 at 08:38