<s> import csv <EOL> import os <EOL> from xlrd import open_workbook <EOL> path = '<STR_LIT>' <EOL> listing = os . listdir ( path ) <EOL> for filename in listing : <EOL> if filename . endswith ( '<STR_LIT>' ) or filename . endswith ( '<STR_LIT>' ) : <EOL> wb = open_workbook ( filename , on_demand = True ) <EOL> for s in wb . sheets ( ) : <EOL> print '<STR_LIT>' % ( filename , s . name ) <EOL> with open ( '<STR_LIT>' % ( filename . split ( "<STR_LIT:.>" ) [ <NUM_LIT:0> ] , s . name ) , '<STR_LIT:wb>' ) as f : <EOL> writer = csv . writer ( f ) <EOL> for rownum in xrange ( s . nrows ) : <EOL> writer . writerow ( s . row_values ( rownum ) ) <EOL> else : <EOL> pass </s>
