LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parsing out non-numeric characters in a string

Solved!
Go to solution

Bill,

 

What you posted on page 3, is "Command" a string cluster? Because I can't really unbundle mine since it is just a straight string and not a cluster?

 

Thanks,

SM

0 Kudos
Message 51 of 70
(973 Views)

The picture is actually executable code.  You can save it and drag the picture into a block diagram and it will convert itself into code.  (All the other pictures that look like mine in this topic are the same thing.)

 

This was the seed for an actual data entry application that users will use to generate the data you are trying to parse.  The beauty of something like this is that it eliminates the need for fancy syntax checking.  It's not meant to verify data that already exists.  Sorry for the confusion.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 52 of 70
(970 Views)

The downside is that it will be a bit tedious compared to cut and paste, especially if you are doing it 1000 times or so.  That's another reason why I didn't push it that hard.

 

But if you're willing to trade a bit of convenience at the front end for peace of mind at the back end, it may be worth doing.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 53 of 70
(967 Views)

Bill,

 

I didn't know that was possible (mind blown)... Is there any way you can post that in LV 2013? Yours is 2014 and won't let me place it into mine.

Thanks,

SM

0 Kudos
Message 54 of 70
(955 Views)

What would be some additional stuff to add to the RegEx or Search And Replace Pattern such that I could parse out any extra decimal place (such as 123...456) or extra negative signs (such as ---123) or extra tilde's (such as [123~~~456~789] ) or a plus sign or non-alphabetic character (such as !123 or +123)?

Attached is a screen shot of my current code.

 

Thanks,

SM

0 Kudos
Message 55 of 70
(942 Views)

@Sman29 wrote:

Bill,

 

I didn't know that was possible (mind blown)... Is there any way you can post that in LV 2013? Yours is 2014 and won't let me place it into mine.

Thanks,

SM


The boring stuff behind the magic:

png graphics files have the ability to store meta-data which is information not related to the display of the picture.  Normally this might be used for exif-type photo data, but LabVIEW uses this area to store its code.  When you drop this png into the block diagram, LabVIEW sees that meta-data and converts it into real code.  🙂

 

It would've been easier for me to just save this as a LV 13 vi, but I wanted you to have some fun with snippets.  😄select command.png

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 56 of 70
(928 Views)

Bill,

 

Super cool!

 

I was already kind of using this method for manual input for the robot. Is there a way I can populate the cluster via a string from the CSV file? That way it eliminates the bad characters. Or at least from what I understand what your code is doing. With my manual input cluster, if I try to type in a non-numeric/decimal/negative sign character, it reverts the cell back to it's previous valid entry. I'm assuming that's what your goal was?

 

Although even populating a cluster still really doesn't help much, because the method that I have now can parse out alphabetical characters. Now I jsut need a method to parse out duplicate negative sign/decimals/tilde's/etc...


Thanks,
SM

0 Kudos
Message 57 of 70
(921 Views)

My goal was for HUMANS to fill in the cluster.  Then turn it into a string like I did and send it to the csv file.  The cluster would be put into an array, and each element of the array corresponds to one command.

 

This is a very high level view, and the snippet was just to start you off thinking about how to do the human input.  🙂

 

I should probably state this more clearly.  I realize I am depending a lot on inference:

The goal of my snippet was to give you a starting point for creating an application that a human would use to input data so syntax error is completely taken out of the question.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 58 of 70
(915 Views)

Bill,

 

Yes I see that now. Sorry I'm terrible at deducting the point of a message... Unfortunately, like you said I would have to do that manually 1000+ times. I already have a manual method that works fine (quite similar to your code). The method that I am checking from the csv file works great, I just need to ramp up the features, but I don't know how...

 

Thanks,

SM

0 Kudos
Message 59 of 70
(911 Views)

@Sman29 wrote:

Bill,

 

Yes I see that now. Sorry I'm terrible at deducting the point of a message... Unfortunately, like you said I would have to do that manually 1000+ times. I already have a manual method that works fine (quite similar to your code). The method that I am checking from the csv file works great, I just need to ramp up the features, but I don't know how...

 

Thanks,

SM


I realized that I never did actually state the purpose of my post, so I thought I needed to clarify.  Nothing wrong on your part, for sure.  🙂

 

It's good to have options; unfortuantely, I am definitely not the person to help you with RegEx.  You already have the subject matter experts here taking very good care of you.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 60 of 70
(901 Views)