I several HTML files that contain a tag for a name that I want to use for the actual file name.
Example HTML File:
<div class="top">SomethingFile</div>
<a href="../files/15d705df3.txt"/>
Output:
I want the SomethingFile tag to be the name of 15d705df3.txt
15d705df3.txt --> SomethingFile.txt
I have about 800+ text and HTML files with this same format that I would like to rename. I have been attempting to get this working with awk, sed, and grep. But unfortunately I am at a loss and am stuck on creating the initial two variables and using these to rename the file.
Loop over the files, use
sedto extract the new name of the file and then rename the file.