ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extract numbers from string

Solved!
Go to solution

I have image files and I want to extract the nuumbers in the image file name. All my image files look like this:

 

{1D5A0279-41E9} 29.05.2014 17-22-58.59 x1566x1375x2768x2577.png

 

I want to just extract the number after the first x and the second x. I have tried using Match Pattern and then converting them with Fract/Exp String to Number but the output is not always constant of the position I need. How would I go about this? 

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 1 of 6
(8,367 Views)

Hey,

 

either take the scan from string function

 

or split the string at the x to extract the value

 

Regards,

CMW

0 Kudos
Message 2 of 6
(8,366 Views)

How will I scan from the first x take the number and scan the second and take that number also?

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 3 of 6
(8,355 Views)
Solution
Accepted by PauldePaor

How about using "Spreadsheet string to Array" like this?

 

ExtractNumber.png

-----

The best solution is the one you find it by yourself
Message 4 of 6
(8,346 Views)

or this way,

 

scanfromstring.png

 

btw: I wouldn't use special characters and dots in file names.

 

Regards,

CMW

Message 5 of 6
(8,338 Views)

Using regular expression

 

using regex.png

Message 6 of 6
(8,299 Views)