LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to place text in a 2D string array? (code attached)

Solved!
Go to solution

I have hard time placing the text below in a 2D array. Can someone please help? Please do not modify text, also do not mind the data. I made it up.

GRCK5000_0-1717439031423.png

Front panel:

GRCK5000_1-1717439075793.png

 

This below 👇 is what I want to out of the given string, but how do I achieve this?

GRCK5000_2-1717439120391.png

 

 

 

 

0 Kudos
Message 1 of 5
(541 Views)

One way is to look for the field delimiters on the original string. 

Use function Match pattern to look for delimitators for example Data, The Title, and once you find them, look for the end of the string (\r\n for example)

then  transform the reaming string  into a 2D string and select the desired columns. 

Then at the end, build the 2D array from the data fields you found on the previous steps. 

 

LVNinja_1-1717447540464.png

 

Message 2 of 5
(502 Views)
Solution
Accepted by topic author GRCK5000

Here's what I might do:

 

altenbach_0-1717447898303.png

 

Message 3 of 5
(499 Views)

Thank you, Mr. Altenbach! This is exactly what I want to achieve.

0 Kudos
Message 4 of 5
(442 Views)

Make sure to fully understand exactly how it does it, especially if you need to make modifications later.

 

The real flaw is that the input text is not really well formatted for processing, so maybe you can change code upstream and modify whatever generates that string. You also need to be careful for unusual inputs, for example if the String on the first line contains a delimiter by accident ("=", linefeed, etc.), things will break. Also make sure to use the correct terminology and don't call a 2D string array a "table" (as in your first post) unless you are actually using a table indicator.

0 Kudos
Message 5 of 5
(431 Views)