ASCII DataSet Cache
Author: ronc
Creation Date: 10/5/2015 12:19 PM
profile picture

ronc

#1
I have a DataSet I created from ASCII. If I modify the original file, from which the DataSet was created, this appears to modify the DataSet too. It appears that WL is reading from the file, rather from an internal copy of the data. This wreaks havoc with my work since the dataset was created with a WL script that exports data, and anytime I open that script it overwrites the file. Also of course any other change to the file breaks this too.

The documentation says that there is an option to cache the data when creating the DataSet but no such option appears in the UI for me. How can I tell WL to create its own copy/cache of the DataSet?

Thanks,
Ron
profile picture

Eugene

#2
In "General" again? ASCII import is a WL feature, so I'd expect to find your post under "Wealth-Lab Developer/Pro" where we "discuss features of Wealth-Lab Pro and Developer" according to the category description. "General" is only acceptable for really borderline cases like "Best data feed", "Choice of SSD" or "Pay for programmer's help". Hope this makes it clear.

QUOTE:
It appears that WL is reading from the file, rather from an internal copy of the data.

That's by design. The ASCII provider is smart enough to re-read from the file rather from its outdated internal copy. Whenever an exported ASCII data is changed - whether by an external utility or by a Strategy - the binary cache is cleared and created from scratch.

QUOTE:
The documentation says that there is an option to cache the data when creating the DataSet but no such option appears in the UI for me. How can I tell WL to create its own copy/cache of the DataSet?

I believe it goes enabled by default but you can make sure on the Data Manager's ASCII tab.

QUOTE:
This wreaks havoc with my work since the dataset was created with a WL script that exports data, and anytime I open that script it overwrites the file. Also of course any other change to the file breaks this too.

Obviously not the ASCII provider as it's a read-only tool (with regard to the original CSV file). As it's not clear enough to me what your script is doing, please clarify.
profile picture

ronc

#3
I create a temporary (well, planned to be temporary) file using my version of the ASCII export script http://www2.wealth-lab.com/WL5WIKI/kbExportDataFromWL5.ashx. The file is on the Windows desktop as a temp file, which I then import as a DataSet via the DataManager. Anytime I open the export script, e.g. to modify the script or create a new dataset, the script reruns, using whatever symbol and timeframe happen to selected in the left-hand pane, and overwrites the data file.

As a kluge I could move that file to some other location and rename it before importing as a DataSet. But then I have to keep track of what WL datasets correspond to what files and their paths, and make sure those files are always there. Instead what I want to do is just have WL import the data and then keep it, without again referencing the original source file. In other words the imported dataset should not change until I tell WL to update it, just like all of the other datasets. How to do this?
profile picture

Eugene

#4
QUOTE:
Anytime I open the export script, e.g. to modify the script or create a new dataset, the script reruns, using whatever symbol and timeframes happen to selected in the left-hand pane, and overwrites the data file.

Is that a problem? Just to name a few, there are several ways to prevent immediate execution. Open the script in MSB mode (click on a DataSet rather a symbol before opening it). Or use a "boolean" Strategy parameter to overwrite only when you manually slided it. Use the "Don't execute Strategy on open" design pattern.

QUOTE:
But what I want to do is have WL import the data and then keep it, without again referencing the original source file.

You might consider creating a "native" DataSet from binary *.WL files generated by SaveToFile. Follow this how-to: How to create a DataSet from SaveToFile() *.WL data
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).