Andrew Porter
5/28/2008 10:18:00 PM
I have a directory full of HTML files. Some have anchor tags (<a =20
href=3D"directory/filename.html">), some do not. I also have a tab-=20
delimited text file with=97among other things=97an ID, title, and =
filename.
What I need to do is create a script that will:
1. Search all of the HTML files in a directory for anchor tags
2. Strip out the file name from the href attribute
3. Use the file name to look up the correlating ID in the lookup file
4. Replace the contents of the href attribute with the ID
Being new to Ruby and command-line scripting, I'm not sure where to =20
begin looking for examples of how to do this. Any help is appreciated.