0

How to batch remove entire string of superscript <sup>text here</sup> from an html document. The <sup> tags are being used for foot notes and there are over 900, but I want to delete them altogether from the document.

I use Linux and Windows so which ever works for getting this done.

Joao
  • 1
  • 1

2 Answers2

0

On linux, you can use the sed command with the -i flag (in-place edit)

sed -i 's/<sup>\w+<\/sup>//' /path/to/filename.html
F.Igor
  • 4,119
  • 1
  • 18
  • 26
  • I just tried it no errors but it did not remove them. here is a sample of what I want to remove: 1 – Joao Jun 29 '20 at 23:57
  • I looked up the man pages for sed, and I tried this:(( sed -i 's/.*//' index.html )) but I get this error: sed: -e expression #1, char 17: unknown option to `s' – Joao Jun 30 '20 at 00:39
0

So I could not get sed to edit the html file, but here is how I did it.

I used xed text editor and used the "Find and Replace" tool with this code: <sup.*</sup> just be sure that the .* button is on on the left side. It found all instances of the superscript tags and just replaced with empty space.

Joao
  • 1
  • 1