Permalink
Browse files

Allow conversion of named tab for xlsx files

  • Loading branch information...
skarra committed Aug 27, 2012
1 parent cc22887 commit 370a7b2a31d8e63b14d302f5205298f3cad0eb39
Showing with 5 additions and 1 deletion.
  1. +5 −1 csvkit/convert/xlsx.py
View
@@ -36,7 +36,11 @@ def xlsx2csv(f, output=None, **kwargs):
writer = CSVKitWriter(output)
book = load_workbook(f, use_iterators=True)
- sheet = book.get_active_sheet()
+ if 'sheet' in kwargs:
+ sheetn = kwargs['sheet']
+ sheet = book.get_sheet_by_name(sheetn)
+ else:
+ sheet = book.get_active_sheet()
for i, row in enumerate(sheet.iter_rows()):
if i == 0:

0 comments on commit 370a7b2

Please sign in to comment.