Hello Everyone, I would like to do the exact opposite of what Robert is trying to do, and am clueless regarding how to achieve it.
More specifically… I have 31,102 HTML documents. Each one contains one verse from the KJV Bible. Currently, these files are named consecutively like this: KJV.00001.html KJV.00002.html KJV.00003.html KJV.00004.html KJV.00005.html The title tag in each HTML document contains the actual Bible reference, followed by a short description. For example, "KJV.00001.html" has "Genesis 1:1 - KJV ( King James Version ) Bible Verse" in the title tag. I need a way to take just the reference part of the title tag, and make it the actual file name, so that "KJV.00001.html" becomes "Genesis_1-1.html". In other words, I want to drop the " - KJV ( King James Version ) Bible Verse" part of the title tag when I create the actual file names. I want the book name to be followed by an underscore, instead of a space, and the colon in each verse reference will have to be replaced with a hyphen, since we cannot use the colon in file names on the Macintosh. I need a script or text factory of some sort which will perform this conversion automatically on all 31,102 files. I imagine that this is a tall order; but considering the power that is hidden in BBEdit, can it be done? BTW, I am still using 9.6.3. Thanks, WW On Sep 15, 2011, at 1:51 AM, Robert Gilman wrote: > The context for my question is that I have a group of about a thousand .html > files that I am converting into database records so the content can become > custom post types in WordPress. I am planning on using a Text Factory to do > most, if not all, of the conversion, but am willing to use any automation > approach that works. > > As part of this I would like to insert the name of each file into the file > itself. I could do this manually with Edit > Copy Path > Copy Name and then > Paste or I could do it manually with a clipping using the #File# placeholder. > I'm stumped, however, on how to automate this process. > > Any ideas on how to do this? > > Thanks! -- 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>
