#!/usr/bin/env python

from nptdms import TdmsFile
import numpy as np
import time
import csv
import os

myfile = open('2.5mb.txt', 'w')

for n in range (0,20):
	start = time.time() 
	#Read the TDMS file
	tdms_file = TdmsFile(r"\\VBOXSVR\Downloads\test_data\zrychleni_vertikalni_frezka.tdms")
	data = tdms_file.object(tdms_file.groups()[0], tdms_file.group_channels(tdms_file.groups()[0])[0].channel).data
	#np.savetxt(r"C:\Users\anton\Documents\pytho\napeti_piezokompozit_letadlo_full.csv", (data), delimiter=',')
	data.tofile("file_%s.csv" % n,sep=',',format="%10.17f")
	end = time.time()
	t = (end - start)
	myfile.write("%s\n" % t)
	time.sleep(0)
	os.remove("file_%s.csv" % n)
	
myfile.close()
