Hello all,
I am trying to use DIAdem Script to automate my measurement conversion from .tdms to .csv.
To load as a list, I use the function FileNameGet which generates and saves a list of measurements.
Using a loop, I then iterate and convert each file after reading using FR.
The problem is FileNameGet always writes as Unicode even after changing my DIAdem environment encoding to ASCII.
On the other hand, FR does not support Unicode.
Currently, I always pause the execution, open the list of experiments and convert them to ASCII manually using a text editor, before proceeding.
Do you know of any better solution? (See my full code below)
I am a novice and will be glad to count on your assistance.
Thanks in advance and regards.
Call FileNameGet("ANY","FileRead",strText1, strText2, strText3, strText4, strText5)
strText5 = FR(LoadPath & "text.txt",1)
If MsgBox("Save as ASCII complete?",vbQuestion + vbYesNo) = vbYes Then
' Just to pause execution
End If
I = 1
While strText5 <> "EOF"
strText5 = FR(LoadPath & "text.txt" ,I)
if strText5 <> "EOF" then
Call DataFileLoad(strText5,"TDMS","Load")
Call DataFileSave(strText5&".csv","CSV_EXPORT")
DataDelAll()
Call LogfileWrite(strText5 & " is done")
End If
I = I + 1
Wend