02-01-2019 03:34 AM
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)
02-04-2019 01:30 AM
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")
02-04-2019 03:39 AM
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.
02-04-2019 05:34 AM
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.