Hello Bruce, Thank-you for your very useful and practical PERL script. I am not sure when or how I will use it, but this is the kind of golden nuggets that I love to save from this list for possible future reference.
While I don't participate often on the list, I do appreciate all of the constructive comments and suggestions which have been made here, and the many code snippets which have been freely shared here. It never ceases to amaze me how powerful BBEdit really is, once one begins to understand the power that is under the hood, and I personally have barely scratched the surface, due to my limited knowledge of PERL, PHP, etc. I do have a grep question for you and others here. As I have mentioned before on the list, I have the entire KJV Bible broken down into 31,102 individual HTML files as a part of the Google search engine queries feature on our main website. In order to further refine user search queries, what I would like to do is this: Each file obviously has its own unique title tag, such as this: <title>Obadiah 1:4 - KJV ( King James Version ) Bible Verse</title> Each file also has a keywords tag, except at this current time, they are NOT unique. In other words, all 31, 102 look like this: <meta name="keywords" content="kjv,bible,verse,king james"> Each file also has a comment string right above the page anchor. They are NOT unique. They all look the same like this: <!-- kjv,bible,verse,king james --> So, what I want to do is change BOTH the keywords tag, as well as the comment string, so that they also include the actual verse reference that is found in the title tag. So, if we use the example above... <meta name="keywords" content="kjv,bible,verse,king james"> Would change to this... <meta name="keywords" content="Obadiah 1:4,kjv,bible,verse,king james"> And this… <!-- kjv,bible,verse,king james --> Would change to this… <!-- Obadiah 1:4,kjv,bible,verse,king james --> You will notice that with both the keywords tag and the comment string, I wish to place the verse reference at the beginning, followed by a comma, as that will give the reference more weight than the other included keywords. I guess the tricky part is that the title tag contains more than just the verse reference itself. It also contains the " - KJV ( King James Version ) Bible Verse" which doesn't need to be copied to the keywords tag, or to the comment string. So I am assuming that two step might be necessary in order to add the full title, and then to delete the part of the title that I don't need there. So, how would I be able to make these two changes in each of the 31,102 files, which each contain a different verse reference in the title tag? Thanks to anyone who can assist me with this. I imagine that this is probably a piece of cake for some of you, but it is beyond my current abilities to figure out. WW -- You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at <http://groups.google.com/group/bbedit?hl=en> If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group. Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
