DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple delimiters in DataPlugin

Hello

How do we specify more than one delimiter in a DataPlugin?

 

File.Formatter.Delimiter = " ", ";", "."?

 

or

 

File.Formatter.Delimiter = ";. "

 

If I have a delimiter of <space><space><space>, can I make this a delimiter? The distinction is needed because there is also a text channel to read in with single <space>, which I would not want to have split.

Thank you.

Michael

0 Kudos
Message 1 of 4
(5,990 Views)

Hi nimic,

 

unfortunately this isn't possible with in the formatter object.

There is another option to do this, since a Dataplugin is, and this is now very simplified, a VBAI Script.

So technically you could use std VBA functions to work at the string wich is the output of a function run with one delimiter.

 

Regards,

Frank

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

Hi Michael,

 

according to Franks reply some addinitional information about the Delimiter in an DataPlugin.

 

It is possible to use multiple chars as delimiter. If you want to do that, you can write

File.Formatter.Delimiters = vbTab & ";,"

if the delimiter could be a tab OR a semicolon OR a comma.

 

But it is not possible to define 3 <space> as one delimiter. Each <space> will be recognized as one delimiter. I think one solution is to use the <space> as delimiter after all. After the DataPlugin imports all the data from your file, you can check if the first value of each data channel is a NoValue. If this condition is true, remove the channel from the channel group.

 

Regards, Stephan

 

 

Message 3 of 4
(5,954 Views)

Hi Guys,

 

If you have multiple space delimiters and you want to treat each contiguous grouping of 2 spaces or 3 spaces or 5 spaces as one combined delimiter, you can do this with 2 property sets to the File.Formatter and then use the normal String Block approach in the VBScript DataPlugin:

 

File.Formatter.Delimiters = " "
File.Formatter.TrimCharacters = " "

 

I have never gotten multiple delimiters to work,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 4
(5,917 Views)