Skip to content

Instantly share code, notes, and snippets.

@pmarkun
Created July 18, 2013 18:26
Show Gist options
  • Select an option

  • Save pmarkun/6031689 to your computer and use it in GitHub Desktop.

Select an option

Save pmarkun/6031689 to your computer and use it in GitHub Desktop.
import json, re
arquivo = open('vereador.txt', 'r')
arq = arquivo.readlines()
campos = re.compile(r'(.*?)#', re.UNICODE)
atributos = re.compile(r'\^[a-z]')
for c in re.findall(campos, line):
for i in c.split("%"):
print re.sub(atributos, '^', i).split('^')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment