06-09-2008 06:31 AM - edited 06-09-2008 06:32 AM
06-10-2008 08:42 AM
06-10-2008 09:50 AM
06-12-2008 07:40 AM
Interesting (hidden?) feature!!
Is there a way to specify the "Delimiter" & "NoValueSign" aswell?
And perhaps also to add a unitrow easy?
Regards
06-13-2008 06:01 PM
06-17-2008 09:47 AM
Hi Sabcat,
You can temporarily rename the first channel to create header rows above the channels and temporarily rename the last channel to create channel header rows, such as unit information, then rename the channels back to their original values after the CSV export. It's low-tech, but it works, and uses the full efficiency of the CSV data export, which runs in C++ code. I have attached an example VBScript below which does this programmatically. You will need to edit the DataFileSave() line to include the extra XML from the other posts to get your custom delimiter and comma options. I don't know of any way to affect the NoValue text.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
05-16-2023 07:50 AM
Thanks Walter,
I could use it to insert the separator "," instead of the "tab".
Is there a possibility to replace the Path "D:\temp\EXAMPLE.csv" with a textvariable ( T1 or tMyPath) with individual Path?
<filename>D:\temp\EXAMPLE.csv</filename>
Thanks and regards,
Multimeter_HIII
12-07-2024 01:11 PM - edited 12-07-2024 01:25 PM
@Brad_Turpin wrote:
Hi Sabcat,
You can temporarily rename the first channel to create header rows above the channels and temporarily rename the last channel to create channel header rows, such as unit information, then rename the channels back to their original values after the CSV export. It's low-tech, but it works, and uses the full efficiency of the CSV data export, which runs in C++ code. I have attached an example VBScript below which does this programmatically. You will need to edit the DataFileSave() line to include the extra XML from the other posts to get your custom delimiter and comma options. I don't know of any way to affect the NoValue text.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
After all these years - still a big THANK YOU!
We have a customer who wants his data converted to CSV and in the second row the units. Made me puzzled. I even thought about to learn how to create an own Plug In. But here came the soluton, finally!
"Simply" put a "vbCRLF" after the last channel name and copy all the channel units into this "second row":
Dim Kanaele, Kanal, KanalUnit
Set Kanaele = Data.GetChannels("*")
KanalUnit = Kanaele(1).UnitSymbol
For Kanal = 2 to Kanaele.Count
KanalUnit = KanalUnit & ";" & Kanaele(Kanal).UnitSymbol
Next
Set Kanal = Kanaele(Kanaele.Count)
Kanal.Name = Kanal.Name & vbCRLF & KanalUnit
Call DataFileSave(Path & CSVName & ".CSV")