LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Separate the string dynamically

Solved!
Go to solution

Dear Sir,

 

I am reading the instrument name using NI MAX. For example TCPIP0::192.168.9.2::inst0::INSTR is the instrument name and iwant to separate the IP address from that string.

 

I used the string sepatare function and i gave some offset for this string, finally i separated.

 

Assume the IP address changes to 10.1.8.93 how do i seperate. For this again i have to give seperate offset.

 

Please let me know the procedure to extract the IP dynamically.

 

Regards,

S Nagaraju

 

 

0 Kudos
Message 1 of 6
(3,070 Views)
Solution
Accepted by topic author Sonti_11532

There are a few ways to do this.  Here is a solution using the Search/Split String twice to find the "::" and getting the IP address.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(3,064 Views)
Solution
Accepted by topic author Sonti_11532

And just to make Jeff Bohrer happy, here is a solution using the Split String VI.  That is a VI hidden inside of vi.lib that is not on the palettes.  Check out Darren's Hidden Gems for more info on it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 6
(3,061 Views)
Solution
Accepted by topic author Sonti_11532

Try this:

Find IP.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 6
(3,031 Views)
Solution
Accepted by topic author Sonti_11532

You can also do it with a regular expression (regex).

 

Ben64

 

extract IP.png

Message 5 of 6
(3,007 Views)

Thank you very much for your replays.

 

Regards,

S Nagaraju

0 Kudos
Message 6 of 6
(2,966 Views)