Page 1 of 1
Bulk Export to CSV
Posted: Fri Aug 01, 2025 11:24 am
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?
Re: Bulk Export to CSV
Posted: Thu Aug 07, 2025 1:49 pm
by tomfid
You can write a .cmd script to do it using the VDF2CSV command.
Re: Bulk Export to CSV
Posted: Thu Aug 07, 2025 1:49 pm
by tomfid
The Action Recorder generates the needed command when you do one manual export.
Re: Bulk Export to CSV
Posted: Fri Aug 08, 2025 1:03 am
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?
Re: Bulk Export to CSV
Posted: Sat Aug 09, 2025 6:18 am
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.
Re: Bulk Export to CSV
Posted: Sat Aug 09, 2025 6:29 pm
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.