Bulk Export to CSV

Use this forum to post Vensim related questions.
Post Reply
geo_curious
Senior Member
Posts: 149
Joined: Tue Mar 14, 2023 2:05 am
Vensim version: DSS

Bulk Export to CSV

Post by geo_curious »

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?
tomfid
Administrator
Posts: 4027
Joined: Wed May 24, 2006 4:54 am

Re: Bulk Export to CSV

Post by tomfid »

You can write a .cmd script to do it using the VDF2CSV command.
tomfid
Administrator
Posts: 4027
Joined: Wed May 24, 2006 4:54 am

Re: Bulk Export to CSV

Post by tomfid »

The Action Recorder generates the needed command when you do one manual export.
geo_curious
Senior Member
Posts: 149
Joined: Tue Mar 14, 2023 2:05 am
Vensim version: DSS

Re: Bulk Export to CSV

Post by geo_curious »

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?
Administrator
Super Administrator
Posts: 4864
Joined: Wed Mar 05, 2003 3:10 am

Re: Bulk Export to CSV

Post by Administrator »

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.
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
geo_curious
Senior Member
Posts: 149
Joined: Tue Mar 14, 2023 2:05 am
Vensim version: DSS

Re: Bulk Export to CSV

Post by geo_curious »

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.
Post Reply