clc;
clear all;
%
myfile = fopen('500mb_m.txt', 'w');
%
for n = 1:20
%start timing    
tic
%load tdms -- paste file path
my_tdms_struct = TDMS_getStruct('\\VBOXSVR\Downloads\test_data\Voltage2.tdms');
format long
%write tdms to csv
    fid = fopen(sprintf('file%s.csv', string(n)),'w');
    fprintf( fid,'%10.17f,',my_tdms_struct.g_07_05_2019_08_46_53___Voltage___All_Data.cDAQ1Mod1_ai1.data);
    fclose(fid);
%dlmwrite(sprintf('dlmfile%s.csv', string(n)),(my_tdms_struct.g_07_05_2019_09_08_49___Voltage___All_Data.cDAQ1Mod1_ai1.data),'delimiter',',', 'precision', 17);
%stop timing
t = toc;
%write time to file
fprintf(myfile,'%s\n',t);
delete (sprintf('file%s.csv',string(n)))
end
%
fclose(myfile);