DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Comma delimated to semicolon delimated

I have an xlsx file which i am saving it to a .csv file. The .csv file is a comma delimated file and I nned it to be semi colon delimated(;) one. Can it it be possible via vb script.

I am using 

 

Call myWorksheet.SaveAs(newpath2&"\"&"CSVFileName_" &Data.Root.Properties("DATE").Value  &  ".csv",6)

 

 

0 Kudos
Message 1 of 4
(2,772 Views)

In DIAdem you can call a script like this to save a comma seperated file or use the file dialog and save to "CSV_EXPORT" and export accordingly.

Option Explicit 

dim filePath : filePath = "C:\temp\CSVFileName_" & replace(Data.Root.Properties("datetime").Value, ":", "_") &  ".csv"
' configure export
dim expParams : Set expParams = Navigator.Settings.CreateDataPluginParameter("CSV_EXPORT")
expParams.Delimiter = eCSVExportDelimiterComma
expParams.DecimalSign = eCSVExportDecimalSignPoint
' write file
call DataFileSave(filePath, expParams)

or just export to Excel by saving or calling

Option Explicit 

dim filePath : filePath = "C:\temp\CSVFileName_" & replace(Data.Root.Properties("datetime").Value, ":", "_") &  ".xlsx"
call DataFileSave(filePath, "ExcelTdmExport")

 

0 Kudos
Message 2 of 4
(2,747 Views)

I reframe the question.

I am writing some data,after calculations, from tdms file to .xlsx file.  I am then saving this file as .csv.

At the moment I am able to save the .csv as Comma(,) Delimated but I need it to be a semi/colon delimated(;).

I don't want to save the tdms into .csv.

And it Needs to be done via script. 

0 Kudos
Message 3 of 4
(2,740 Views)
Option Explicit 

dim filePath : filePath = "C:\temp\CSVFileName_" & replace(Data.Root.Properties("datetime").Value, ":", "_") &  ".csv"
' configure export
dim expParams : Set expParams = Navigator.Settings.CreateDataPluginParameter("CSV_EXPORT")
expParams.Delimiter = eCSVExportDelimiterSemicolon
expParams.DecimalSign = eCSVExportDecimalSignPoint
' write file
call DataFileSave(filePath, expParams)

Be aware that some semicolon deperated files also need the decimal settings to be changed.

0 Kudos
Message 4 of 4
(2,736 Views)