You are on page 1of 1

from google.

colab import files


from google.colab import drive
import sys
drive.mount('/content/drive')

sys.path.insert(0,'/content/drive/MyDrive/test1')

import xlsxwriter

# Reading an excel file using Python


import xlrd

# Give the location of the file


#loc = ("Traces1500.xlsx")

# To open Workbook
#wb = xlrd.open_workbook(loc)
#sheet = wb.sheet_by_index(0)

workbook = xlsxwriter.Workbook('/content/drive/MyDrive/test1/cpa_results.xlsx')
worksheet = workbook.add_worksheet()

# Start from the first cell.


# Rows and columns are zero indexed.
row = 0
col = 0
#row1 = 0
#col1 = 0
k = 0
for i in range (0,4000):

if ((i == 10)|(i == 100)|(i == 1000)|(i == 10000)):


k = k + 1

msg = "C1 traces00000.xlsx"


test_msg = msg[0:(13-k)]
chif = msg[(13-k):14]
ind = '.xlsx'
a = int(chif) + i
b = str(a)
print (test_msg+b+ind)
loc = ('/content/drive/MyDrive/CPALED/'+test_msg+b+ind)
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(0)
row = 0
#col = 0

for j in range (50005):


text = sheet.cell_value(row, 0)
#text = remove (str(text))
worksheet.write(row, col, text)
row+=1
col+=1

workbook.close()

You might also like