Skip to content

Instantly share code, notes, and snippets.

@Gabriel-Chen
Created June 24, 2018 06:06
Show Gist options
  • Save Gabriel-Chen/774801e1fc7a28265f57e5c3642b25dc to your computer and use it in GitHub Desktop.
Save Gabriel-Chen/774801e1fc7a28265f57e5c3642b25dc to your computer and use it in GitHub Desktop.
Remove All Accent on Letters in a CSV File
# This gist is initially used for analysing data in Spanish
import unidecode
import csv
def remove_accent (feed):
csv_f = open(feed, encoding='latin-1', mode='r')
csv_str = csv_f.read()
csv_str_removed_accent = unidecode.unidecode(csv_str)
csv_f.close()
csv_f = open(feed, 'w')
csv_f.write(csv_str_removed_accent)
return True
if __name__ == "__main__":
remove_accent('Respons.csv')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment