Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pytonh leer txt y quitar tildes acentos

import sys 
reload(sys) 
sys.setdefaultencoding("utf-8")
import csv
import unicodedata

def remove_accents(input_str):
    nkfd_form = unicodedata.normalize('NFKD', unicode(input_str))
    return u"".join([c for c in nkfd_form if not unicodedata.combining(c)])

with open('test.txt') as f:
    read = csv.reader(f)
    for row in read:
        for element in row:
            print remove_accents(element)
Source by www.iteramos.com #
 
PREVIOUS NEXT
Tagged: #pytonh #leer #txt #quitar #tildes #acentos
ADD COMMENT
Topic
Name
9+2 =