I have data in relational database form that I'd like to import into Vensim. The DLIST2VDF function looks perfect, but...
Working from the Vensim help
https://www.vensim.com/documentation/in ... st2vdf.htm
I made a tab-delimited file that looks like this:
variable region time value
asdfasdf US 1950 1
asdfasdf US 1960 2
I call the DLIST2VDF function with a .cmd file with one line:
MENU>DLIST2VDF|?datafile|
I open the .cmd file using File > Open Model > Command Scripts (*.cmd) then pick the tab delimited file.
I get the following warnings:
WARNING: No variable found on line 1: variable region time value.
Line 1 of file test.txt.
WARNING: No variable found on line 2: asdfasdf US 1950 1.
Line 2 of file test.txt.
WARNING: No variable found on line 3: asdfasdf US 1960 2.
Line 3 of file test.txt.
Encountered 3 warnings and 0 errors reading data
Writing 0 values for time base -Time
I can't see yet what I'm doing wrong? Any help would be appreciated!
DLIST2VDF challenges
-
- Super Administrator
- Posts: 4680
- Joined: Wed Mar 05, 2003 3:10 am
Re: DLIST2VDF challenges
What happens if you remove the first line and try importing?
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
Re: DLIST2VDF challenges
It turns out to be an easy fix. The algorithm that is supposed to guess the delimiter isn't working for some reason. If you rename the file to .tab, it knows what to do.
/*
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: DLIST2VDF challenges
Works like a charm! Friendly suggestion, please add a note to the help file suggesting naming the file with .tab extension, until delimiter guess routine is fixed?
Re: DLIST2VDF challenges
Maybe delimiter guess is a dumb idea and should simply be deleted?
/*
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: DLIST2VDF challenges
In a pinch, I can live with tab-delimited. But CSV files are very common.
Guessing the delimiter is a nice-to-have: it would be ok with me if delimiter was specified through one of the arguments to DLIST2VDF, e.g.
MENU>DLIST2VDF|?datafile||, for comma delimited
MENU>DLIST2VDF|?datafile||t for tab delimited, etc.
Guessing the delimiter is a nice-to-have: it would be ok with me if delimiter was specified through one of the arguments to DLIST2VDF, e.g.
MENU>DLIST2VDF|?datafile||, for comma delimited
MENU>DLIST2VDF|?datafile||t for tab delimited, etc.
Re: DLIST2VDF challenges
You can use csv now, if the extension is csv.
/*
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: DLIST2VDF challenges
When I run the command script with the ?datafile argument (summoning a dialog bos allowing me to pick the data file for processing), the filter allows tab-delimited files only: files with .csv extension are not listed, and so cannot be selected
Files with .txt extension do appear. When processing a .txt file that is in fact comma-delimited, I get the previous errors.
Files with .txt extension do appear. When processing a .txt file that is in fact comma-delimited, I get the previous errors.
Re: DLIST2VDF challenges
I think you'd have to give up the ?file wildcard and use filename.csv directly.
/*
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
*/