Permalink
Browse files

Add --sheet option to in2csv for XLSX files

  • Loading branch information...
1 parent 370a7b2 commit 11e99117fee6c735c116272bc337395a0d73ed52 @jpmckinney jpmckinney committed Sep 4, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 csvkit/utilities/in2csv.py
@@ -21,6 +21,8 @@ def add_arguments(self):
help='Specifies a top-level key to use look within for a list of objects to be converted when processing JSON.')
self.argparser.add_argument('-y', '--snifflimit', dest='snifflimit', type=int,
help='Limit CSV dialect sniffing to the specified number of bytes.')
+ self.argparser.add_argument('--sheet', dest='sheet',
+ help='The name of the XLSX sheet to operate on.')
def main(self):
@@ -61,6 +63,9 @@ def main(self):
if self.args.snifflimit:
kwargs['snifflimit'] = self.args.snifflimit
+ if self.args.sheet:
+ kwargs['sheet'] = self.args.sheet
+
# Fixed width can be processed as a stream
if format == 'fixed':
kwargs['output'] = self.output_file

0 comments on commit 11e9911

Please sign in to comment.