Skip to content

Commit

Permalink
fixed spaces in header bug
Browse files Browse the repository at this point in the history
  • Loading branch information
animesh-chouhan committed Jun 30, 2021
1 parent 36d9c65 commit cb6e424
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vcf_creator/vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,18 @@ def vcard_generator(filename):
# Read the csv file
reader = csv.reader(csvfile, dialect)
# Get header
header = reader.__next__()
header = [h.strip() for h in reader.__next__()]
# Name is required
if "Name" not in header:
print("Header not supported.")
return -1

# Iterate over the rows
# Set attributes_present
for i, attr in enumerate(header):
attributes_present[attr] = i

ret = []
# Iterate over the rows
for row in reader:
ret.append(vcard_formatter(row))
return "\n".join(ret)

0 comments on commit cb6e424

Please sign in to comment.