Skip to content

Instantly share code, notes, and snippets.

@underyx
Created September 11, 2012 19:14
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 underyx/3701116 to your computer and use it in GitHub Desktop.
Save underyx/3701116 to your computer and use it in GitHub Desktop.
# This Python file uses the following encoding: utf8
import sys
import re
def oooParser(filename):
text = [re.sub("[/\t].+","",line) for line in open(filename).read().splitlines()]
return text
def androidWriter(filename,outtext):
outfile = open(filename, 'w')
outfile.write("|".join(outtext))
def main():
if len(sys.argv) != 3:
print 'usage: ./dictconv.py file-to-read file-to-write'
sys.exit(1)
outtext = oooParser(sys.argv[1])
androidWriter(sys.argv[2],outtext)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment