LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete unkown number of characters in a string

Solved!
Go to solution

hello ! 

I have this string : <tr><td class='hdr_name'><b>Station ID: </b></td><td class='hdr_value'><b>BT-LED-PUISSANCE</b></td></tr>

(yes it's HTML)

I want to erase all the parts delimited by <>, so in the end i must have ''Station ID: BT-LED-PUISSANCE''

I think i must use a Scan from string but i don't know what to put in the format string. any help ?

 

0 Kudos
Message 1 of 10
(353 Views)

How is this related to "signal conditioning" and hardware? (...since you posted here in this forum)

 

What programming language are you using?

0 Kudos
Message 2 of 10
(333 Views)
Solution
Accepted by topic author Ripers_546

Assuming you are using LabVIEW, here is a solution.

 

One solution.png

 

No doubt a RegEx or html specialist will be able to suggest a more effective one.

0 Kudos
Message 3 of 10
(311 Views)

ok i'm sorry i didn't realy knew where to put this request, and to answer, yes i'm using labview (the community eddition).

 

after taking the time to test, it works as i wanted thanks you ! 

0 Kudos
Message 4 of 10
(301 Views)

(Ah, good to know that this is a LabVIEW question! I have moved this thread to the LabVIEW forum for better visibility.)

 

The most efficient way is to operate directly on the bytes. Here's one possibility:

(I am sure it can be simplified further)

 

altenbach_0-1650899490858.png

 

0 Kudos
Message 5 of 10
(280 Views)

@altenbach wrote:

(Ah, good to know that this is a LabVIEW question! I have moved this thread to the LabVIEW forum for better visibility.)

 

The most efficient way is to operate directly on the bytes. Here's one possibility:

(I am sure it can be simplified further)

 

altenbach_0-1650899490858.png

 


I'm fairly sure, (under the condition that the Tags are well formated) that ">" Implies a preceding "<"

That and a value changed vim should make the code a bit easier to read.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 10
(235 Views)

@JÞB wrote:

That and a value changed vim should make the code a bit easier to read.


Well, a "!=" (or XOR) toggles the Shift register if the other input is TRUE. That's all we really need. Not sure how you would implement it using the vim and how that would simplify things. 😄

0 Kudos
Message 7 of 10
(231 Views)

If you want code that's easier to read, here's an alternative. (Still no vim needed). 😄

 

altenbach_0-1650906632608.png

 

0 Kudos
Message 8 of 10
(203 Views)

Learning a little Regex is helpful sometimes.  I can testify to that because I've only learned a little...

jcarmody_0-1650907725333.png

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 9 of 10
(190 Views)

@jcarmody wrote:

Learning a little Regex is helpful sometimes.  I can testify to that because I've only learned a little...


Certainly better than this old suggestion 😄

 

In my defense, I am sure my code is orders of magnitude faster. 😄 (not tested)

0 Kudos
Message 10 of 10
(177 Views)