10-04-2023 01:57 AM
Hello,
I am facing issue in write a string into array. I am reading a text file using Read from Text File.vi in a For loop and matching a string match pattern. VI which gives me desired string. Now the string which I have got at output, I am not able to put this string into array. I have tried doing the auto index function of for loop for creating the array. Please suggest a way to build the array.
Solved! Go to Solution.
10-04-2023 02:07 AM
Your task is really easy. Please post your code possibly in LabVIEW <= 2021 (maybe also a snippet or picture) to let us see where's the error.
10-04-2023 02:09 AM
Hi Swami,
@Rohan1612 wrote:
I have tried doing the auto index function of for loop for creating the array. Please suggest a way to build the array.
When you want to "build an array" you should consider using the BuildArray function!
10-04-2023 02:22 AM
Please see the snippet for the code.
Thanks in advance.
10-04-2023 02:37 AM
When Match Pattern function fails to find a match, a -1 is issued in offset past match. Use this value to filter the output.
Unless your LabVIEW version is rather old, you may right click on the output tunnel making it conditional, then wire offset past match >= 0 the conditional terminal:
10-04-2023 03:01 AM
Hi Rohan,
@Rohan1612 wrote:
Please see the snippet for the code.
This is not a snippet, it's just an image of your code. Snippets are special to LabVIEW: read the LabVIEW help to learn about them!
You already create an array of strings, so I don't know why you claim "you are not able to put the string into array"!?
10-04-2023 07:54 AM
Thanks for the solution. I could build an array.
10-04-2023 07:56 AM
Thanks GredW for the input on Snippets. I will surely look into it.