dimanche 6 août 2017

How can merge same data cell on xlswriter?

I made some script for xlsxwriter.

my script read some text file and modify using xlsxwriter.

i made below script.

cap_file = 'mod_cap_sum.txt'
cap_table = pd.read_table(cap_file, encoding='utf_8', sep=',', header=None, names=['Storage Group','LUN Count','LUN Capacity'], lineterminator='\n')

worksheet.write('H2', 'Count', bold)
worksheet.write('I2', 'Capacity', bold)

data = (cap_table)

row = 2
col = 7

for index, temp_data in data.iterrows():
        if index != 0:
                worksheet.write(row, col, temp_data[1], border)
                worksheet.write(row, col + 1, temp_data[2], border)
                row += 1

I want made a script same data check and merge.

How can make same data cell merge script?

below is mod_cap_sum.txt file.

Storage Group,LUN Count,LUN Capacity
18B19   10  3312000
18B19   10  3312000
17B14   15  132000
17B14   15  132000
18B19   10  3312000
17B15   11  12000

I want made output like below picture.

enter image description here

Aucun commentaire:

Enregistrer un commentaire