Skip to content

Instantly share code, notes, and snippets.

@lzubiaur
Created November 4, 2015 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lzubiaur/8a608d851a3a23b72f07 to your computer and use it in GitHub Desktop.
Save lzubiaur/8a608d851a3a23b72f07 to your computer and use it in GitHub Desktop.
Remove xml/html tags from a file
#!/usr/bin/env python
# coding=utf-8
import re
import sys
with open(sys.argv[1], 'r') as _in, open(sys.argv[2], 'w') as _out:
for line in _in:
line = re.sub('<.[^>]*>', '', line)
_out.write(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment