Hi all,
I have a ton of .vdfx files to export to csv. Is there a more efficient way to do this than to select each individual file than export through the export tool window?
Bulk Export to CSV
-
- Senior Member
- Posts: 149
- Joined: Tue Mar 14, 2023 2:05 am
- Vensim version: DSS
Re: Bulk Export to CSV
You can write a .cmd script to do it using the VDF2CSV command.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Bulk Export to CSV
The Action Recorder generates the needed command when you do one manual export.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Senior Member
- Posts: 149
- Joined: Tue Mar 14, 2023 2:05 am
- Vensim version: DSS
Re: Bulk Export to CSV
Ok. Thanks Tom. I am learning new things here. I see the Action Recorder saving the format, which appears a little different than the documentation. I got the same save action from a couple of different implementations of the .cmd.
MENU>VDF2CSV|file1.vdfx|file1.csv|savelist.lst|*[
...appears to do the same thing as:
MENU>VDF2CSV|file1.vdfx|file1.csv|savelist.lst|*{||||0
But, it looks like there would be no reason to use the first case if there were no subscripts.
Is there any way to run a for loop from the .cmd in the Vensim text file interface, or should I just write a line for each "file1, file2, file3" and so on?
MENU>VDF2CSV|file1.vdfx|file1.csv|savelist.lst|*[
...appears to do the same thing as:
MENU>VDF2CSV|file1.vdfx|file1.csv|savelist.lst|*{||||0
But, it looks like there would be no reason to use the first case if there were no subscripts.
Is there any way to run a for loop from the .cmd in the Vensim text file interface, or should I just write a line for each "file1, file2, file3" and so on?
-
- Super Administrator
- Posts: 4864
- Joined: Wed Mar 05, 2003 3:10 am
Re: Bulk Export to CSV
There isn't a way to run the loop.
The next release, it can export multiple files to the same output file. For example, you select a.vdfx and b.vdfx and get exportedfiles.tab. Is that what you need here or do you need a.vdfx -> a.tab and b.vdfx -> b.tab.
In fact, I'll insert some extra code to allow the user to do both.
The next release, it can export multiple files to the same output file. For example, you select a.vdfx and b.vdfx and get exportedfiles.tab. Is that what you need here or do you need a.vdfx -> a.tab and b.vdfx -> b.tab.
In fact, I'll insert some extra code to allow the user to do both.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Senior Member
- Posts: 149
- Joined: Tue Mar 14, 2023 2:05 am
- Vensim version: DSS
Re: Bulk Export to CSV
Ok, sounds good. Thank you for the advice. I think it is all working on my end to run multiple lines, albeit a bit ornery because the data is in the cloud and seems to be calling archived .vdfx files on occasion - not a Vensim problem.
I was just looking to export 1 .vdfx to 1 .csv, because I have already set up a separate python script for plotting, but it would be great if in the future it could be multiple .vdfx to 1 .csv/.tab.
I was just looking to export 1 .vdfx to 1 .csv, because I have already set up a separate python script for plotting, but it would be great if in the future it could be multiple .vdfx to 1 .csv/.tab.