Article 4SR12 how to change the content of lines in an html file using regex/grep

how to change the content of lines in an html file using regex/grep

by
toothwright
from LinuxQuestions.org on (#4SR12)
I am running Linux Mint 19.2.

I have an html file containing 1400 lines of this sort:-

<li>Some Name <a href="http://www.anything.co.uk/name.htm">REF NUMBER</a></li>
The line between <a href=" and .htm"> is of variable length.

I want to change the lines to read:

<li><a href="local directory/X.pdf">Some Name REF NUMBER</a></li>

I will replace X in the line manually (as it varies).

The object is to remove the online requirement for the list.

I know it must be possible with regex or grep and I have spent time looking at tutorials but without real comprehension.

I should be grateful if a member would be kind enough to provide me with help/clues....latest?d=yIl2AUoC8zA latest?i=l2BbmM-jb9c:QWWs3O5Tadg:F7zBnMy latest?i=l2BbmM-jb9c:QWWs3O5Tadg:V_sGLiP latest?d=qj6IDK7rITs latest?i=l2BbmM-jb9c:QWWs3O5Tadg:gIN9vFwl2BbmM-jb9c
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments