DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving R32 data files as csv

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?

0 Kudos
Message 1 of 5
(2,798 Views)

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?

0 Kudos
Message 2 of 5
(2,793 Views)

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?

 

0 Kudos
Message 3 of 5
(2,757 Views)

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!

0 Kudos
Message 4 of 5
(2,743 Views)

Can you add some information?

  • DIAdem Version
  • Bitness 64/32 bit
  • Windows version

P.S.:I assume sending an example file does not work because even zipped it is to big. Right?

0 Kudos
Message 5 of 5
(2,707 Views)