DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to export data to an excel file using VBScript

Hi Kade,

 

I looked into your question today, and what I discovered was that the CSV DataPlugin only exports channels from the same group.  So I edited the "ASCII Export with CSV Headers.VBS" script so that if you select all the channels in the Data Portal, the script will temporarily move those channels to a new "CSV Export Group", export those channels, then move the channels back where they came from.  This is the best I can come up with given the apparent limitation of the CSV export function in DIAdem.  It works pretty well, but it does have the artifact that channels that have identical names in different groups receive an index suffix to their name in the CSV file-- this is because those channels can not have the same name in the temporary "CSV Export Group", and DIAdem automatically renames them with the suffix.

 

Brad

 

0 Kudos
Message 11 of 16
(2,991 Views)

Thanks, I actually did something similar yesterday, I dont move the channels back since I am loading the file from TDMS files.

0 Kudos
Message 12 of 16
(2,989 Views)

Hi g8vngy,

 

i had the same problem some months ago, after trying the cvs export and a direct export over ole and some other things.

I accepted that the best solution are mutible stp files. I included the stp files for 1 to 61 channels as attachment. Now i use a small script that select the stp file that fits via globusedChn and check if the export was done.

(stp files for export everything, even channel-comments)

 

 

  

diademi

0 Kudos
Message 13 of 16
(2,961 Views)

why go throught all these hassels where you could write your stp file before export.

 

you know the format of stp, before export prompt a dialog to select number of chns & length to export, there you go.

0 Kudos
Message 14 of 16
(2,851 Views)
I asked NI for a stp-file specification, and they can´t give me one, so i walked this way.
0 Kudos
Message 15 of 16
(2,849 Views)

1.stp

 

#2=MAIN('1','',0,(''),(''),(''),(0));
#3=IMPORT(0,0,0,(''),(''),(),(),(0),(),(),(),(0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0),0,0,(0,0),(0,0,0,0,0,0),(0,0,0,0,0));
#4=EXPORT('DIAdem','DIAdemProp',1,1,1,1,1,1,(1,1),(1,
1,1,1,1,1),(1,1,1,1,1),1,1,1,1,1,1,1,1,(1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1),(1));
ENDSEC;
END-ISO-10303-21;

 

2.stp

 

#2=MAIN('1','',0,('',''),('',''),('',''),(0,0));
#3=IMPORT(0,0,0,('',''),('',''),(),(),(0,0),(),(),(),(0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0),0,0,(0,0),(0,0,0,0,0,0),(0,0,
0,0,0));
#4=EXPORT('DIAdem','DIAdemProp',1,1,1,1,1,1,(1,1),(1,
1,1,1,1,1),(1,1,1,1,1),1,1,1,1,1,1,1,1,(1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1),(1,2));

 

10.stp

 

#2=MAIN('1','',0,('','','','','','','','','',''),('','','','',
'','','','','',''),('','','','','','','','','',''),(0,0,0,0,0,
0,0,0,0,0));
#3=IMPORT(0,0,0,('','','','','','','','','',''),('','','',
'','','','','','',''),(),(),(0,0,0,0,0,0,0,0,0,0),(),(),(),(0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0),0,0,(0,0),(0,0,0,0,0,
0),(0,0,0,0,0));
#4=EXPORT('DIAdem','DIAdemProp',1,1,1,1,1,1,(1,1),(1,
1,1,1,1,1),(1,1,1,1,1),1,1,1,1,1,1,1,1,(1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1),(1,2,3,4,5,6,7,8,
9,10));

 

Compare #2MAIN and last line of #4 EXPORT in stp 1, 2 and 10

 

See the patterns here?

 

regards

Steven

 

 

0 Kudos
Message 16 of 16
(2,816 Views)