Skip to content

Instantly share code, notes, and snippets.

@DastanIqbal
Last active May 21, 2018 09:57
Show Gist options
  • Save DastanIqbal/deeb67f3b4f6fd8fe31732a5729b7937 to your computer and use it in GitHub Desktop.
Save DastanIqbal/deeb67f3b4f6fd8fe31732a5729b7937 to your computer and use it in GitHub Desktop.
import sys
separator = "="
file = open(sys.argv[2],'w')
file.write('<?xml version="1.0" encoding="utf-8"?>\n')
file.write('<resources>\n')
with open(sys.argv[1]) as f:
for line in f:
if separator in line:
name, value = line.split(separator, 1)
file.write('<string name="'+name.lower()+'">'+value+'</string>\n')
file.write('</resources>')
file.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment