From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

paste from clipboard

Solved!
Go to solution

Hello!

 

I am trying to paste in different string indicators what it is in the clipboard. 

In the clipboard there will be three values, as you can see in the image and i want to display each in a different indicator. However I am getting only the first one...

What should I change?

 

Thanks a lot in advance!

Jess

0 Kudos
Message 1 of 11
(4,889 Views)

ss,

 

most probably you're using the wrong search char!

 

Display the received string in an indicator and set its display mode to "\-code". Then you will see the "end of line" character in your string.

After you know which one to use you could use SpreadsheetStringToArray to split up your string into three parts much easier than using MatchPattern!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 11
(4,879 Views)

Since you only posted a picture I have no idea what to change.  A starting place would be to put an indicator on the output of the clipboard read and then switch it to "\" code view.  There could be hidden characters in the string.

0 Kudos
Message 3 of 11
(4,876 Views)

I guess your line separator is not correct. Check code of the separator (string indicator in "\ codes display" mode). Carriage return is \r

Also you can use match pattern instead, [\r\n]+ as pattern (one ore more \r or \n in any combination)

 

Message 4 of 11
(4,872 Views)

Thanks for the suggestions!

 

I am trying to get the array. However i am getting in the first array element the all the values of the clipboard. I have tried with tha tab delimiter to split the string and with the space constant as you can see in the image...

Any idea about how to separate it..

 

Thanks!

0 Kudos
Message 5 of 11
(4,824 Views)

Hi jess,

 

again you just attached an image instead of a snippet or VI…

And you also forgot to provide example data too!

 

The separator is probably either LF or CR - see for yourself with the suggestions you got so far!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 11
(4,818 Views)

@GerdW wrote:

 

again you just attached an image instead of a snippet or VI…


 

http://www.ni.com/tutorial/9330/en/

 

Basically a snippet is an image, that has executable LabVIEW source in it.  You can post it to the forums and it can be seen, but you can also run the picture in LabVIEW by dragging it to a block diagram.

0 Kudos
Message 7 of 11
(4,788 Views)

Thank you!

 

I am attaching the snippet. I have managed to get what I want (each line in a different indicator) with a string that has the following attributes>

abc;

def;

ghi;

 

However I am not able to add the ";" at the end of each line. I have tried what I have attached. Any suggestion?

 

Thank you very much!

0 Kudos
Message 8 of 11
(4,745 Views)

I am trying to get ";" after the end of each line as attached.

However I don't get it.. I have tried with end of line constant, tab constant and several others..

 

Any idea to make it work?

 

Thanks!

0 Kudos
Message 9 of 11
(4,732 Views)
Solution
Accepted by topic author jess1006

Hi Jess,

 

Any idea to make it work?

Using the correct char to search and replace would help here (as has been mentioned before!)…

 

Like this:

check.png

The upper part shows a different solution with less code…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 11
(4,694 Views)