LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

regular expression to remove trailing zeros

Solved!
Go to solution
Actually Search and Replace does use an honest-to-goodness regex (notice the little star). It is a good method to fix up spreadsheet files where one column which requires 6 digits of precision bloats every other column. Someday LV will support multiple column formats directly and I will no longer have integer columns with six zeroes after the radix point.
0 Kudos
Message 11 of 16
(1,414 Views)

@Darin.K wrote:

Well, since you asked my quick answer is to not look at which parts to grab from the string, but rather which parts to eliminate.  I would go with a Search & Replace: 

 


Exactly my point. "Kosher" use of regular expression suppose to grab the result from a string, but here it is much easier to grab the part to eliminate.

0 Kudos
Message 12 of 16
(1,413 Views)

@Sergey Kolbunov wrote:

@Darin.K wrote:

Well, since you asked my quick answer is to not look at which parts to grab from the string, but rather which parts to eliminate.  I would go with a Search & Replace: 

 


Exactly my point. "Kosher" use of regular expression suppose to grab the result from a string, but here it is much easier to grab the part to eliminate.


And since the trailing zeros are at the end of the string we can use before match output of Match Regular Expression function.

 

RemoveTrailingZerosRegex.png

 

Ben64

Message 13 of 16
(1,404 Views)
This worked just like what I was looking for. Thanks!
0 Kudos
Message 14 of 16
(1,386 Views)
I tried your way, but it did not work for me. I got the same results as before as in 2.30000. So, I went for the solution above by Jim,
0 Kudos
Message 15 of 16
(1,383 Views)

@Z.K. wrote:
I tried your way, but it did not work for me. I got the same results as before as in 2.30000. So, I went for the solution above by Jim,


ZK,

 

Who are you responding to?  When you click on reply, it gives you a message at the end of the thread.  There is no way anyone reading the thread can know who you are responding to.

 

Use the quote button at the top of the dialog to insert the message you are replying to.

0 Kudos
Message 16 of 16
(1,335 Views)