03-28-2018 03:18 PM
Hi,
I'm new to DIAdem and VB scripts and want to convert data files automatically to csv. I have a "data.DAT", "data.R32" and "data.TSX" file for multiple "data"s.
If I run the following code, only the header information from "data.DAT" is saved in the csv:
ElementList = DataFileLoad("data.DAT", "DAT", "LoadImmediately") Call DataFileSave("data.CSV", "CSV")
How can I also save the data from "data.R32" in the CSV?
03-28-2018 03:53 PM
I added
Call Data.Root.Clear()
so the code looks like this
ElementList = DataFileLoad("data.DAT", "DAT", "LoadImmediately") Call DataFileSave("data.CSV", "CSV") Call Data.Root.Clear()
and the real data is now saved to the csv.
Sadly, only the first ~250k lines match the resulting csv when I export the data by hand. The following 2 million lines are empty but with some newlines or tabs. Both files have the same number of lines.
Does someone now this issue?
03-29-2018 03:24 AM
I tried the following
Option Explicit data.Root.clear call ChnGeoGen("/GeometricGenerated1",1,30,2250000,"") call ChnGeoGen("/GeometricGenerated2",1,40,2250000,"") call ChnGeoGen("/GeometricGenerated3",1,50,2250000,"") call ChnGeoGen("/GeometricGenerated4",1,60,2250000,"") Call DataFileSave("C:\temp\out.CSV", "CSV")
Which creates a CSV file with the according values.
How many channels do you save.
Is it possible that it is an memory issue? Can you check in Process Explorer?
03-29-2018 10:53 AM
Hi Andreas,
your code works fine and produces a file with 2250000 lines.
I have 42 channels in my data and the export uses maximal 700MB RAM with circa 5GB free.
Another origin of the problem could be that I use Windows in a VM but I don't believe so.
Thanks for your help!
04-03-2018 03:27 AM
Can you add some information?
P.S.:I assume sending an example file does not work because even zipped it is to big. Right?