Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- """
- padronização contatos sc89
- p120221readcontatov1.py
- gsavix at google mail dot com
- """
- #%%
- axfe = open('Z:/d17down/contatos-std/contatos-whats/contatos-entra.txt', 'r')
- axreg = axfe.readlines()
- axfe.close()
- axregs = ''
- axfs = open('Z:/d17down/contatos-std/contatos-whats/contatos-saida.txt','w')
- for axn in axreg:
- axregw = axn
- axregw = axregw.replace('\n','')
- if axregw[:11] == 'BEGIN:VCARD':
- axregs = ''
- axcard = list()
- if axregw[:3] == 'FN:':
- axcard.append(axregw)
- if axregw[:14] == 'TEL;TYPE=CELL:':
- axcard.append(axregw)
- if axregw[:9] == 'END:VCARD':
- for axlin in axcard:
- axregs = axregs + axlin + '|'
- axfs.write(axregs + '\n')
- print(axregs)
- axfs.close()
- #%%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement