Just as it is often useful to move data into Vensim, it can also be useful to export data out of Vensim. The special format that Vensim uses to archive data and simulation results is powerful and convenient for use within Vensim, but not accessible to other applications. To make results created in Vensim accessible for use elsewhere, you can export data from the Table tool, or use the Export Dataset functions. These functions allow you to extract some or all of the information contained in a .vdf file.
When you invoke the command Model>Export Dataset, you will first be asked for the name of a dataset to convert. You can select any dataset, it does not matter if it comes from the current model, or was itself the result of importing data. Once you have selected a dataset you will see the Dataset Export Options dialog:
This dialog allows you to select the format to export the data in and contains a number of options:
Export to lets you specify the file you want to export the data to. If you leave this blank, the data will be exported to a filename with the same name as the dataset being exported and an extension appropriate for the type of file you are exporting to.
Unicode UTF-8 (Vensim Standard) lets you specify the text encoding for the output file. Not all programs will read UTF-8 text. Click on this button to select an alternate encoding. ANSI Standard may work better with Excel. If you do not have any characters in the model variables beyond A-Z, a-z, numbers and punctuation the results will be the same for any encoding.
Export as lets you set the format for the exported data. You can export to a .dat format file, a tab delimited file, a Lotus 123 format spreadsheet file, an Excel format spreadsheet or a data list format. The .dat format file is discussed under importing. Tab delimited is just a tabular view of output. The data list format is actually a tab delimited file with each line in the form:
Variable | Time Value |
or if Put subscripts in own cols is checked
Variable | Sub1 Sub2 Time Value |
Where the first line contains the subscript range names used and later lines the subscript constants. Note that the order of subscripts will follow the subscript range names from the first row and is not dependent on the order of subscripts in the model variables. This is intended to make it easier to get the data into a database.
If Add cols is checked then the entry in the editing box is included as
Variable | Sub1 Sub2 Extra1 Time Value |
This redundant format is useful if you are loading values into a database or want to create pivot tables. Use an exclamation point ! to add the current run name (most useful in batch mode). Note that if you want to add more than one extra column separate the values with a \t as in modeloutput\tExperiment1
Save List allows you to name a file containing the list of variables you would like saved. If this is left empty, all the variables in the model will be saved. If a name in the list is not found, an error will be reported and processing will continue with the other names. You can create and modify the save list by clicking on the Ed… button to the right.
Time Running lets you set whether time will run across or down. Because some spread sheet programs have limitations on the number of columns it may sometimes be useful to have time running down. This option has no effect on .dat format files or datalist format files.
Put Subscripts lets you set whether you want to see subscripts with the variable name, or in their own columns (rows if time is running down). Putting subscripts in separate cells can make it easier to read and analyze a spreadsheet. The default is to put subscripts as part of the variable name enclosed in square brackets []. When subscripts are put into separate cells the values for the variables will be shifted over to the left (or down) for all variables. Variables that do not have subscripts will be followed by one or more blank cells.
Time from lets you specify the first time to be exported and to the last time to be exported. If these are left blank the full time range will be exported. If you specify with interval values will only be exported on that interval. If you leave this blank all values in the range will be exported. If you leave all of these fields blank all the value will be exported.
Append data to file determines whether the data is added to the end of a file. If you select this option and the output file already exists the data will be appended to the end of the file instead of overwriting the file. This can be a useful option if you want to record the results of a number of experiments in one place.
Don't Show Time allows you to suppress the Time axis. This is most useful when you are appending data and don't want to keep repeating the values for Time. Not applicable to .dat or datalist format files.
Write numbers in European format allows you to output numbers using the, as the decimal separator.
Export Units allows you to output the units of each parameter.