1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
import xlrd
import os
def main():
fichier_xls=fichier_xls='FLUX_SC1_detaille.xls'
book = xlrd.open_workbook(fichier_xls)
sh = book.sheet_by_index(0)
ch_xls=""
for row_1 in range(0,sh.nrows):
var_data = sh.cell(row_1,0).value
var_module = sh.cell(row_1,29).value
var_gpe_docm = sh.cell(row_1,22).value
var_fct_docm = sh.cell(row_1,23).value
try:
ch_xls=ch_xls+(var_data.encode('utf-8')+'*'+var_module.encode('utf-8')+'*'+var_gpe_docm.encode('utf-8')+'*'+var_fct_docm.encode('utf-8'))+'|'
except:
ch_xls=ch_xls+(var_data+'*'+var_module+'*'+var_gpe_docm+'*'+var_fct_docm+'*'+var_fct_docm)+'|' |
Partager