Skip to content

Instantly share code, notes, and snippets.

View fegoa89's full-sized avatar

Fernando González fegoa89

  • Almería, Spain
View GitHub Profile
# ANSI color codes
RS="\[\033[0m\]" # reset
HC="\[\033[1m\]" # hicolor
UL="\[\033[4m\]" # underline
INV="\[\033[7m\]" # inverse background and foreground
FBLK="\[\033[30m\]" # foreground black
FRED="\[\033[31m\]" # foreground red
FGRN="\[\033[32m\]" # foreground green
FYEL="\[\033[33m\]" # foreground yellow
FBLE="\[\033[34m\]" # foreground blue
@fegoa89
fegoa89 / format_duplicated_rows.py
Created May 12, 2015 10:26
Create a new CSV without duplicated rows in Python
# python -t format_duplicated_rows.py
with open('input.csv','r') as in_file, open('output.csv','w') as out_file:
seen = set()
for line in in_file:
if (line in seen):
continue
else:
seen.add(line)
out_file.write(line)