extracting numbers from a string

Hi ,
I am trying to find a way to extract all possible numbers from a string ;
for instance the string :

win2000 john 6.25e-3 12.34 wtk75a -17

would give me the results in an array of numbers:

2000.00000
0.00625
12.34000
75.00000
-17.00000

In LabVIEW6.1 there is an example doing so; only the problem lies in the
scientific notation number:
the example sees this part of the string as two seperate numbers: 6.25
and -4 .
Ofcourse I want this VI to see this part of the string as one single number
(0.00625) .

Anyone help will be appreciated ,

Ren� Ramekers
The Netherlands



0
rra1 (17)
11/25/2005 11:35:19 AM
comp.lang.labview 35390 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

4 Replies
671 Views

Similar Articles

[PageSpeed] 55
Hi,
 
Try using Fract/exp string to number.
 
It will do the job
 
Regards
 
Dev
 
 


frac_string.vi:
http://forums.ni.com/attachments/ni/170/153671/1/frac_string.vi
0
x9561 (148624)
11/25/2005 12:10:34 PM
Sorry Rene, the attached Vi was in LabVIEW 7.1.
 
So, u might not be able to open it.
 
Nevertheless you will find this function 'Fract/Exp String To Number'., in functions palette -> string-> string/number conversion on LabVIEW 6.1 too, so it should not be a problem.
 
Regards
 
Dev
 
0
x9561 (148624)
11/25/2005 12:10:35 PM
Devchander is right on the money but I think you will need a little bit more to parse the string. 
This is very similiar to the Extract Numbers.vi example that ships. The only difference is the number format that is extracted for the string using Match Patten.  The Match Pattern returns -1 when it can't any more matches where as Fract/Exp String To Number returns 0 which could be ambiguous.
<img src="http://forums.ni.com/attachments/ni/170/153677/1/Extract%20Numbers.jpg"> 
Might not be bomb proof but it worked for the string you posted.
cheers
David
Message Edited by David Crawford on 11-25-2005  06:37 AM


Extract Numbers.jpg:
http://forums.ni.com/attachments/ni/170/153677/1/Extract Numbers.jpg
0
x9561 (148624)
11/25/2005 12:40:39 PM
Thanks devchander & David ,

it works perfectly ,

Ren�

"David Crawford" <x@no.email> wrote in message
news:1132922439537-292746@exchange.ni.com...
> Devchander is right on the money but I think you will need a little bit
more to parse the string.
> This is very similiar to the Extract Numbers.vi example that ships. The
only difference is the number format that is&nbsp;extracted for the string
using Match Patten.&nbsp; The Match Pattern returns -1 when it can't any
more matches where as Fract/Exp String To Number returns 0 which could be
ambiguous.
> <img
src="http://forums.ni.com/attachments/ni/170/153677/1/Extract%20Numbers.jpg"
>
> Might not be bomb proof but it worked for the string you posted.
> cheers
> David
> Message Edited by David Crawford on 11-25-2005  06:37 AM
>
>
> Extract Numbers.jpg:
> http://forums.ni.com/attachments/ni/170/153677/1/Extract Numbers.jpg


0
rra1 (17)
11/28/2005 7:29:53 AM
Reply:
Similar Artilces:

Advice Numbering pages/panels
Hello, I am looking for some advice on page identification. See I am writing this information based program that has several panels that are swapped in and out of view like any normal app. For tech support or other reasons I would like to have a page identifier (PID) on every screen. For various reasons I don't want to put the PID in the title bar. I am thinking of trying to find a wxDC somewhere (having a hard time) and putting it up in a corner somewhere. * Is there a way I can get a wxDC to write around the edges as not to be overlapped by a control? * Is this a bad idea...

Extracting records
Hi, I am looking for a solution to this problem. I receive a list of records like this, in one continuous string. I want to separate each record and extract some of the data for each record. The records look like this: (=YEAR:1991;month:[JAN]client-NAME:[Ali-Baba-Basket-Emporium]AREA:[SouthEast]value:[�1905]=)(=YEAR:1997;month:[dec]client-NAME:[Fletcher]AREA:[Scotland(North)]discount:[7%]value:[�741]=)(=YEAR:2003;month:[MAR]client-NAME:[Porridge-dot-com]AREA:[N.Ireland]discount:[7%]value:[�335]=) For example, in this record: (=YEAR:2003;month:[MAR]client-NAME:[Porridge-dot-com]AREA:[N.Irelan...

Invoice/ Record Line/Sequence Numbering
Hi there, I need a little help create a Invoice Line numbering (sequence) and transaction time in order to be able to import Sales history I have been told that it can be achieved via sql and or vba module in access97, I have some idea of sql but none in vba. I have manually generated InvLinNo and TransTime in this sample file but the actual file has 788216 lines, how could I achieve this is Access, either by SQL or VBA. The script needs to look at CusNo, InvDate and InvNo and if they are same then assign an incremental number starting from "000" or else insert "000"...

Extract Number From Text String
Hello, Does xHarbour have a function to extract Number from a text string? Regards Otto Dear Otto Haldi: On Monday, September 17, 2012 11:48:58 AM UTC-7, Otto Haldi wrote: .... > Does xHarbour have a function to extract > Number from a text string? http://www.ousob.com/ng/53guide/nga7e04.php val() David A. Smith On Mon, 17 Sep 2012 12:05:13 -0700 (PDT), dlzc <dlzc1@cox.net> wrote: Hello David, Thanks for your help. Yes, I know the function val() I mean for that kind of string : "abc-2344-2323". Regards Otto >Dear Otto Haldi: >...

Picture format
hello everyone, I've been using the following to format percentages in proc report: proc format; picture pic(round) 1 - < 10 = "000.0%)" ( prefix = "( " ) 10 - < 100 = "000.0%)" ( prefix = "( " ) 100 - < 1000 = "000.0%)" ( prefix = "(" ) other = " " ; run; This was working really great until I had percents betweein 0 and 1 come up. In that case the format came up like this ( 5%) rather than (0.5%) which it should have been. I have a feeling that I need another statement in my pro...

Capturing that Unix job number
I have been executing an awk command as a background job: awk blahblah & Immediately, AIX displays this message showing job number and PID: [4] 12345 <carriage return> The output of the awk command eventually follows, but the "[4] 12345" isn't included. I need the "[4] 12345" to be available for a shell variable. Do you have a suggestion on how to capture the string? So far, it's been suggested that the awk command be followed by "echo $!" (without quotes), which indeed shows the PID but not the job number... (Neale) wrote > I have...

extract values from a csv file
Hi All, I would like to know how to extract values using shell script from csv files and store the value in variables and then display the values I need something like this var1 = a var2 = 230 var3 = david var4 = 450 and then display the values where csv file has ab,230,david,450 gh,430,jack,678 aa,560,sam,340 Thanks Deva "deva" <devasingh@gmail.com> wrote in message news:1117867246.217480.268120@g47g2000cwa.googlegroups.com... > Hi All, > > I would like to know how to extract values using shell script from > csv files and store the value...

Extracting text from a webpage
Hello All, This must be an easy question for many of you. Given its URL, I would like to extract the text from a webpage **after the server and client side updates are done**. Can LWP::Simple be used for this? Thanks. q-rious <mittra@juno.com> wrote: >This must be an easy question for many of you. Given its URL, I would >like to extract the text from a webpage **after the server and client >side updates are done**. Please explain what you mean by "server and client side updates". >Can LWP::Simple be used for this? Yes and no. You can certainly use LWP::Simple...

matlab presentations of numbers
how do i set matlab so that the result of x (see http://www.ee.bgu.ac.il/~bezenchu/comm/integration.bmp) will be represented as real numbers and not as rational. thank you "michael " <bezenchu@gmail.com> wrote in message news:fm865m$e0l$1@fred.mathworks.com... > how do i set matlab so that the result of x (see > http://www.ee.bgu.ac.il/~bezenchu/comm/integration.bmp) will > be represented as real numbers and not as rational. > > thank you Use VPA (or if your expression contains no symbolic variables, use DOUBLE.) -- Steve Lord slord@mathworks.com "...

macro help => string into defparameter statement
I'd like to convert a string passed into a macro into a defparameter statement like so: (defmacro how-do-i-do-this (string-passed-in) (defparameter (fancy-shmancy-stuff string-passed-in) bound-to- this)) Obviously this seems useless but I'm using this in a bigger better macro. Is this possible or should I bite the bullet and do it manually? Thanks! -JW jrwats@gmail.com writes: > I'd like to convert a string passed into a macro into a defparameter > statement like so: > > (defmacro how-do-i-do-this (string-passed-in) > (defparameter (fancy-shmancy-stuf...

Extract JEditorPane from swing jar
Hi, I'm developing an applet which need to use JEditorPane, but I don't want to use plug-in with browser. In my understanding, the solution is extracting all classess from swing jar and pack them into another jar along with my applet. The problem is I don't know which classes should I extract from swing jar to make JEditorPane works. Am I on the right way? Please help me !!! thanks, Thang. "Thang Nguyen" wrote: > Am I on the right way? Please help me !!! No, many before you had that stupid idea. ...

Re: Searching for a comma in a string with rxparse #2
Chang- That did the trick nicely. Thanks! Now my next question is, is there a better way to find the first occurrence of a simple string? rxmatch & rxparse seem slow and like they do more than I really care about. Mark Chang Chung wrote: > On Thu, 18 Aug 2005 10:04:04 -0400, Mark Biek <markb@STEVENSONCOMPANY.COM> > wrote: > > >>I'm trying to locate the first occurence of a comma within a string. >> >>I have this snippet: >>pos2 = rxmatch(rxparse(","), details); >> >>but unfortunately it errors out due to the c...

extracting foreground_blobs
hello, in the following image there is a truck and a car. i appear to be intutive can some body please exaplin me how to obtain them (something like extacting one big blob of each of the vehicle.) hello, in the following image there is a truck and a car. it appear to be intutive but i am not able to code to extract them. can some body please exaplin me how to obtain them (something like extacting one big blob of each of the vehicle.) image: (https://docs.google.com/file/d/0BxDBJuGxr2fJWmVJYVhZMDNoR28/edit) ...

string search
Hi I want to know Is there any string search command which returns the entire line when the matches are found. Iam new to TCL, needed your help.Thanks for your response in advance. Regards, Sunitha. Hi, I tried giving this code: set fi [open erra.txt] set re [read $fi] set line [lsearch -glob -inline [split $re "\n"] "*error*"] When I executed it is coming out without any error, but do not showing any result.There are many "error" strings in that file. Can u help me. Regards, Sunitha. Hi I need the entire line to be assigned to a variable, so that I can...

using String#slice with a symbol argument.
Currently, ruby 1.8.6. has the following behavior: 'ruby'[:en] #=> nil The reason is that the symbol is converted to an integer using to_int. But this is never useful, and can be a source of obscure bugs when your variable contains a string instead of an hash. Wouldn't raising an exception be more appropriate? ...

SUbstring Extraction
I have a program that reads input from the user in the form Name("ABC") Addr("DEF") I need to check if Name was mentioned and extract ABC and store it in a variable and if Addr was mentioned and extract DEF and store that in another variable. Eg: if the user inputs Name("Joe") I need to check if he has mentioned Name and extract Joe The user can input Name("Joe") Addr("unit 2 sheperton") in this case i need to extract Joe and unit 2 sheperton and perform the appropirtae functions depending on whether Name or Addr or Both are mentioned. Tha...

The Asian Leading Aloe Extract Manufacturer
We are the largest aloe vera raw materials manufacturer in Asia. We are engrossed in integrated supply of raw Aloe Vera materials. All of our Aloe Vera gels, Aloe Vera whole leaf, concentrates and powders are tested and guaranteed to be biologically active. We had our entire product line certified by the International Aloe Science Council (IASC). We have the following advantages: 1. The Asian largest aloe plantation base. 2. 5 state-to-the-art processing lines(the most in the world) certified by IASC. 3. Standard GMP production workshops. 4. Low-temprerature concentration technology 5. World ...

Picking apart Novell's Linux numbers (Larry Dignan/ZDNet)
http://weblog.infoworld.com/openresource/archives/2007/06/picking_apart_n.html > Larry has a great post that takes Novell's SUSE Linux numbers to task. Novell made much of its "83% jump in SUSE Linux revenues" but failed to highlight all the cracks in those numbers. Larry is much kinder than I would have been, but makes some great points along the way: John A. Bailo wrote: > > http://weblog.infoworld.com/openresource/archives/2007/06 picking_apart_n.html > >> Larry has a great post that takes Novell's SUSE Linux numbers to task. >> Novell made m...

Re: Count a string variable
Monisan, You already have an answer. For your concete variables, count = count (lowcase (catx (",", of cre:)), "yes") ; or, more robustly, count = count (lowcase (catx (",", of cre1-cre10)), "yes") ; Kind regards ------------ Paul Dorfman Jax, FL ------------ On Wed, 30 Sep 2009 07:39:50 -0700, Monisan <mokaesa04@HOTMAIL.COM> wrote: >On Sep 29, 5:16 pm, Monisan <mokaes...@hotmail.com> wrote: >> I need to count the number of Yes in a group of variables. The >> variables are strings, so Yes is Yes not 1. Can I do this with...

el556 onboard LAN/V90 ini strings wanted.
Hello all, situation: We have got laptops HP omnibook 500 here and need to deploy XP on all of them. Now all other computers are running fine with bootdisk-image (PXE boot to be exactly) but the NIC of the Omnibook500 gives us some problems. They do boot, and the NIC is recognized by the bootimage (made in good old plain dos). We had a little problem with the 3c905x, but the 3c905cfg.exe helped us out on this one. So we could force the 100 full duplex mode on that nic. Is there any same kind of tool for the EL556 (also 3com) tool for that or is there a certain string we could add in the proto...

Ideas for extracting fibers
Hey, I'm working on a problem where I have an image of two strings laid across each other and I have to determine quantitative data about the two strings. How might I single each string out? Thanks On Jun 10, 10:22=A0am, "Victor " <a...@aoeu.com> wrote: > Hey, > I'm working on a problem where I have an image of two > strings laid across each other and I have to determine > quantitative data about the two strings. =A0How might I single > each string out? > > Thanks ---------------------------------------------------------------------- Victor: Can...

Generating unique number from two other unique numbers
I would like to generate a unique number from two other unique numbers. With the two input numbers, one is a customer ID number (e.g. 23 = "John Kerry", 97 = "George Bush" etc.) and the other number is a promotion ID (e.g. 5 = "October two-for-one sale", 8 = "Summer free shipping promotion" etc.) The two input numbers are NOT unique against themselves i.e. I could have a customer # 23 redeeming promotion # 23. They are only unique amongst themselves. The end goal is that from a generated number I am able to decode back the customer ID and promotion ID...

Para Numbers
I would like each PARA in the output PDF file to be numbered. Is there a package or command that can accomplish that ? Thanks KE Durrani ------------------------- There is something called numberpar.sty that you can find in this forum, but it might require some tweaking (resetting the count after certain macros that create paragraphs that are not displayed??). Robin said that there is a hacked version on the Internet that might contain a few fixes, but it is still imperfect. vvvv <vnessun@gmail.com> writes: >There is something called numberpar.sty that you can find in this >fo...

extracting function from the list
Hi, all: I can not seem to figure out how to extract a function from the list. for example: mathematica gives me output: {{v->x^2}} How do I extract just x^2 out of that list and assign it to a different variable? thank you, edgar Lobachevskiy Hi, RelaceAll[] my help you, in the case where you can have more than a single solution you have to decide which solution you whant to use and q= v /. {{v->x^2}}[[1]] will help you. Regards Jens edgar wrote: > > Hi, all: > > I can not seem to figure out how to extract a function from the li...

hang-up..Extracting..Extracting
I installed Sol8/Intel on 160 GB . only 131 GB were visible to Sol though I have installed the ata batch before installation I do not know why ?? Any way the PC hang up after the the web start launcher and sol said Extracting Extracting and machine goes into sleep before the Login ? Extracting what ?? What is happening . I always forced to reset machine ? ehabaziz2001@gmail.com wrote: > I installed Sol8/Intel on 160 GB . only 131 GB were visible to Sol > though I have installed the ata batch before installation I do not know > why ?? > Any way the PC hang up after the the web st...