LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Conversion: engineering string to fractional string

Solved!
Go to solution

Hello everyone

 

I am loading a text file with several columns that has text (informations about the file and column titles) and values in engineering format. After I load this file I use "spreadsheet string to array" to convert it to 2D array of strings.

 

I would like to leave all the "text" (informations about the file and column titles) unchanged, but I want all the "engineering values" to be converted to "fractional values". How do I convert an engineering string to a fractional string?

 

I will have to convert the whole file at once because different files have different positions for text and engineering values and because of that would be impossible to know the index of values and convert just them.

 

Thanks.

 

Dan07

0 Kudos
Message 1 of 3
(2,566 Views)
Solution
Accepted by dan07

Hi Dan,

 

conversion is done like that:

check.png

But you have to select, what is text and what is number, on your own. How should LabVIEW know about your file format?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(2,557 Views)

@dan07 wrote:

 

 I will have to convert the whole file at once because different files have different positions for text and engineering values and because of that would be impossible to know the index of values and convert just them.


You will have to loop through your 2D array of strings testing each cell for engineering values to convert and then do what GerdW suggested.

You could use Regular Expressions to detect the engineering values from the text.

 

Omar
0 Kudos
Message 3 of 3
(2,541 Views)