I have a couple hundred HTML files that start off like this:

<html><head>
<title>Unique Page Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="description" content="blah blah blah">
<meta name="keywords" content="long list of keywords, keyword 1, keyword 2">
.
.
.

I need to reduce a copy of these files from the first example above to this:

<title>Unique Page Title</title>
<meta name="keywords" content="long list of keywords, keyword 1, keyword 2">



I will then also need to replace the block of text in that first example, with something like this:

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<!-- Start of Title, Description  & Keywords -->
<title>Unique Page Title</title>
<meta name="description" content="blah blah blah">
<meta name="keywords" content="long list of keywords, keyword 1, keyword 2">
<!-- End of Title, Description  & Keywords -->



Later, I will ultimately need a single tab delimited file that looks like this:

   Page Titles                  Keyowrds
   Unique Page Title1    keywords from page 1
   Unique Page Title2    keywords from page 2
   Unique Page Title2    keywords from page 3
   .
   .
   .
   Unique Page Titlen    keywords from page n


I use BBEdit all the time. I am just not very adept at anything but the simplest grep search.

Any suggestions for the grep patterns to use on this would be helpful and appreciated.

Also, any suggestion about using BBedit (or something else) to get that last file built would be greatly appreciated.

thanks,
Ken


Reply via email to