How to pick number in string

Hi, all
Does have some function can pick number from string.
For example: I have a string like this " **** ** 123 **** ** 45 *** ** 678 *** **", I want to extract the first number (123) from the string.
is there any functions in labview to result ?
Many thanks

Use match pattern with [0-9]+ as regular expression. It is in the string palette.
[0-9]+ matches "A sequence of one or more digits". Check the online help for more details.
(see attached example (LabVIEW 7.0)).
Message Edited by altenbach on 10-12-2005 09:11 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
MatchNumbers.vi ‏22 KB

Similar Messages

  • How to Plot number and string in one row (data logger counter) ?

    hi all i made data log quantity using Digital Counter via modbus to monitoring quantity and reject that has and Name Operator, Machine and Part Number.
    i have problem about plot the number & string in one row, as shown on the picture below :
    how to move that string on one row ? i attach my vi.
    Thanks~
    Attachments:
    MODBUS LIB Counter.vi ‏39 KB

    Duplicate and answered - http://forums.ni.com/t5/LabVIEW/How-to-Plot-number-and-string-in-one-row-data-logger-counter-via/m-p...

  • How to convert number to string in java

    hi how can i convert number to string in java
    something like
    public void Discription(Number ownerName){
    String.valueOf(ownerName);Edited by: adf009 on 2013/04/08 7:14 PM

    Yet another way of doing it is: ownerName.toString().
    If you are working in and IDE such as Netbeans or Eclipse, type a period after the object name. Wait a second or so. Eclipse/Netbeans Intellisense will show you a list of functions that object provides that you can choose from. toString() is one of them.

  • How to Plot number and string in one row (data logger counter via MODBUS) ?

    hi all i made data log quantity using Digital Counter via modbus (RS-485) to monitoring quantity and reject that has and Name Operator, Machine and Part Number.
    i have problem about plot the number & string in one row, as shown on the picture below :
    how to move that string on one row ? i attach my vi.
    Thanks~
    Solved!
    Go to Solution.
    Attachments:
    MODBUS LIB Counter.vi ‏39 KB

    Hi rhiesnand,
    right now you add 2 new rows to your array.
    The solution is to concatenate both row parts to one bigger 1D array before adding that array as new row to your 2D array!
    Like this:
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to find number from text string??

    Hi All,
    Can you tell me how to find/ fetch number from string?
    is there any function module  for this.?
    for example , I have string like "+++++1000000589+++"
    and I need to fetch the invoice no 1000000589 from the above string..then  How to do that? Letters may come first or number may come first and latter text...
    Regards,
    Mrunal

    You can do like this.
    The below mentioned is code separate material
        DO 18 TIMES.
          LV_C = LV_C + 1.
          LV_C1 = LV_C - 1.
          IF  GW_MATNR-MATNR+LV_C1(1) CN '0,1,2,3,4,5,6,7,8,9' .
            IF ( ( LV_MAT EQ SPACE ) ) ."  and ( lv_prefix eq space ) ) .
              LV_PREFIX = 'X'.
              CONCATENATE GW_TEMP-PREFIX GW_MATNR-MATNR+LV_C1(1) INTO
              GW_TEMP-PREFIX.
            ELSE.
              LV_SUFFIX = 'X'.
              CONCATENATE GW_TEMP-SUFFIX GW_MATNR-MATNR+LV_C1(1) INTO
              GW_TEMP-SUFFIX.
            ENDIF.
          ELSEIF ( ( LV_SUFFIX EQ SPACE ) ) .
            LV_MAT = 'X'.
            CONCATENATE GW_TEMP-MATNR1 GW_MATNR-MATNR+LV_C1(1) INTO
            GW_TEMP-MATNR1.
          ELSEIF ( ( LV_MAT EQ 'X' ) ) .
            CONCATENATE GW_TEMP-SUFFIX GW_MATNR-MATNR+LV_C1(1) INTO
            GW_TEMP-SUFFIX.
          ENDIF.
        ENDDO.

  • How to cast a parameter from ${bindings.myParam} which is Number to String

    I have a button which sets a param in request so I do sth like this in event on uix page:
    <set property="param_id" target="${requestScope}" value="${bindings.myParam.attributeValue} "/>
    but that myParam is Number (not String). And I have java.lang cast exception.
    What should I do to cast it?

    I'm sure there is a simpler way but i guess this works:
    <bean:define id="num" name="bindings" property="myParam.attributeValue" type="Number"/>
    <set property="param_id" target="${requestScope}" value="<%num.tostring()%>"/>This is not tested! One other thing to check is JSTL FMT formatNumber but i don't remember the syntax.

  • How to Increase the number of string boxes?

    I have attached a VI in which the number of string boxes in "No:, Questions , Ok/not Ok, Remarks " are eight.
    Can any one help me by changing the number of String/ Numeric boxes from 8 to 50 in all the items?
    I am very new to labview and i got this VI from a friend.
    Thanks in advance
    Sunitha
    Attachments:
    questions.vi ‏172 KB

    I think you will find it much easier if you had an array of clusters.   The array can be sized however big you need it.  On the block diagram, use a for loop to index through the array a perform whatever actions you want on it.  You may also look at event structures to control the read and write. 
    Look through the help files.  They are very complete and the examples offer some good ideas.
    Message Edited by jasonhill on 07-06-2006 10:40 AM
    Attachments:
    array of clusters of controls.PNG ‏22 KB

  • CRM Web UI :- How to Control number of session of Web UI for a user

    Hello Experts,
    We do have very specific requirement which SAP doesn`t recommend in terms of multi-sessioning for a user.So we are little worried upon the challeges.Could you please share your ideas/Experience on following?
    1.How to Control number of Internet explorer session for the web UI (may be 2 or 3).?
      Though SAP doesn`t recommned more than one but our client requires 2 or more than that but we need to fix it either 
      2 or 3.
      So we are looking for specific setting for this.
    2.What are the challenges we need to face if we implement option 1?
    3.Specially in interaction record management
        a. Is there chance of loosing the data if agent has opened more than two session.
        b. In which session interaction record data will get stored,the one on which agent picked up the call or in the latest 
            one?
    Please let me know if I am not clear enough on any point.
    Thanks in advance,
    Shailendra Tolambiya

    Hi Shailendra,
    The following wiki page might be useful in this respect:
    http://wiki.sdn.sap.com/wiki/x/gxdKDQ
    Best Regards,
    Shiromani

  • How can I send multiple string commands into a VISA write?

    Hi Fellow LabVIEW users
    I am very new to LabVIEW (2.5 months) so please forgive me if my lingo is not up to par.
    How can I send multiple string commands to a VISA write. For example each string command looks like this
    1) 3A00 0000 0000 FFFF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0033 (Scenario 1)
    2) 3A01 0000 0000 FFFF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0034 (Scenario 2)
    3) 3A01 0000 0000 33FF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0067 (Scenario 3).
    and so on and so forth. And there are a number of scenarios.
    Each String scenario will give a different string output which will be interpreted differently in the front panel.
    Right now I have to manually change the string commands on the front panel to give me the desired output. How can I do this without manually changing the commands i.e. hard coding each scenario into the block diagram?
    Thanks, any feedback will help.
    mhaque

    Please stick to your original post.

  • How to get number of rows return in SELECT query

    i'm very new in java, i have a question:
    - How to get number of rows return in SELECT query?
    (i use SQL Server 2000 Driver for JDBC and everything are done, i only want to know problems above)
    Thanks.

    make the result set scroll insensitve, do rs.last(), get the row num, and call rs.beforeFirst(), then you can process the result set like you currently do.
             String sql = "select * from testing";
             PreparedStatement ps =
              con.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
             ResultSet rs = ps.executeQuery();
             rs.last();
             System.out.println("Row count = " + rs.getRow());
             rs.beforeFirst();~Tim
    NOTE: Ugly, but does the trick.

  • How to delete number (00) in a SQL Server column ?

    how to delete number (00) in a SQL Server column ?
    example :
    column :        Births       before                     Births 
        after                          
                       199900                            
            1999
                       198200                               
         1982
                       200400                               
        2004
    help query

    You use REPLACE function to selectively replace text inside a string in SQL Server. The REPLACE function is easy to use and very handy with an UPDATE statement.
    SELECT Replace(births, '00', '')
    or
    update .....
    Also you can use STUFF()
    This function can be used for delete a certain length of the string and insert a new string in the deleted place.
    Select STUFF ('199900', 5, 2, '')
    --result 1900,1982,....
    Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/

  • How to find number of files in a folder using pl/sql

    please someone guide as to how to find number of files in a folder using pl/sql
    Regards

    The Java option works well.
    -- results table that will contain a file list result
    create global temporary table directory_list
            directory       varchar2(1000),
            filename        varchar2(1000)
    on commit preserve rows
    -- allowing public access to this temp table
    grant select, update, insert, delete on directory_list to public;
    create or replace public synonym directory_list for directory_list;
    -- creating the java proc that does the file listing
    create or replace and compile java source named "ListFiles" as
    import java.io.*;
    import java.sql.*;
    public class ListFiles
            public static void getList(String directory, String filter)
            throws SQLException
                    File path = new File( directory );
                    final String ExpressionFilter =  filter;
                    FilenameFilter fileFilter = new FilenameFilter() {
                            public boolean accept(File dir, String name) {
                                    if(name.equalsIgnoreCase(ExpressionFilter))
                                            return true;
                                    if(name.matches("." + ExpressionFilter))
                                            return true;
                                    return false;
                    String[] list = path.list(fileFilter);
                    String element;
                    for(int i = 0; i < list.length; i++)
                            element = list;
    #sql {
    insert
    into directory_list
    ( directory, filename )
    values
    ( :directory, :element )
    -- creating the PL/SQL wrapper for the java proc
    create or replace procedure ListFiles( cDirectory in varchar2, cFilter in varchar2 )
    as language java
    name 'ListFiles.getList( java.lang.String, java.lang.String )';
    -- punching a hole in the Java VM that allows access to the server's file
    -- systems from inside the Oracle JVM (these also allows executing command
    -- line and external programs)
    -- NOTE: this hole MUST be secured using proper Oracle security (e.g. AUTHID
    -- DEFINER PL/SQL code that is trusted)
    declare
    SCHEMA varchar2(30) := USER;
    begin
    dbms_java.grant_permission(
    SCHEMA,
    'SYS:java.io.FilePermission',
    '<<ALL FILES>>',
    'execute, read, write, delete'
    dbms_java.grant_permission(
    SCHEMA,
    'SYS:java.lang.RuntimePermission',
    'writeFileDescriptor',
    dbms_java.grant_permission(
    SCHEMA,
    'SYS:java.lang.RuntimePermission',
    'readFileDescriptor',
    commit;
    end;
    To use:
    SQL> exec ListFiles('/tmp', '*.log' );
    PL/SQL procedure successfully completed.
    SQL> select * from directory_list;
    DIRECTORY FILENAME
    /tmp X11_newfonts.log
    /tmp ipv6agt.crashlog
    /tmp dtappint.log
    /tmp Core.sd-log
    /tmp core_intg.sd-log
    /tmp da.sd-log
    /tmp dhcpclient.log
    /tmp oracle8.sd-log
    /tmp cc.sd-log
    /tmp oms.log
    /tmp OmniBack.sd-log
    /tmp DPISInstall.sd-log
    12 rows selected.
    SQL>

  • How do I convert a string, and use a string as a property?

    I have an array in the following format:
    {ownsCar: 'true', ownsBike: 'true', ownsHouse: 'true'}
    {ownsCar: 'false', ownsBike: 'true', ownsHouse: 'true'}
    {ownsCar: 'true', ownsBike: 'false', ownsHouse: 'true'}
    etc ............
    And I need to test against each item e.g.
    if...
    myDataGrid[myItem].ownsCar == Object(myCheckbox).label
    ... then
    if...
    myDataGrid[myItem].ownsBike == Object(myCheckbox).label
    ... then
    if...
    myDataGrid[myItem].ownsHouse == Object(myCheckbox).label
    ... then
    But I need to build my application where the property (e.g. "ownsCar", "ownsBike", "ownsHouse") is a variable such as:
    if...
    myDataGrid[myItem].myProperty == Object(myCheckbox).label
    ... then
    I would like to loop through my Array, counting the number of items, and then use each item as a property.
    How would I convert the string (e.g. "ownsCar") into a property "myProperty" ???
    Many thanks in advance
    Chris

    Thanks, but my problem is that I won't know what my property will be.
    E.g. they could be...
    {svnsdkvnsdklvnsdklv: 'true', seuAfnwfnw: 'true', asfwseionf: 'true', etc.................}
    and there could be lots of them.
    I need to have myObject[N], where N is a variable property for each of the items taken from a variable length array
    so...
    ownsCar is represented by myObject.[N]
    ownsHouse is represented by myObject.[N+1]
    ownsBike is represented by myObject.[N+2]
    etc
    (sorry, this is so difficult to explain when I dont know what the answer is)

  • How to convert Binary to String?

    Hi,
    How to convert Binary to String? Thank!

    Never ceases to amaze me how many people cannot
    accept any form of criticism whatsoever. How dothey
    get through the normal day? Do they pick fightswith
    everyone who says anything to them they don'tlike?
    Was this for me????Who are you calling a psycho??

  • How to calculate  number of sundays and saturdays between two Dates

    friends i want to calculate how many Sundays come in two Dates
    i have tried following code which is hard coded i have to impliment method which can give me number of Sundays between two Dates
    please help me
    import java.util.Date;
         import java.text.DateFormat;
         import java.text.SimpleDateFormat;
         import java.util.Calendar ;
         import java.util.GregorianCalendar;
    public class DateDiffCalculator     {
         private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MMM-dd");
    public DateDiffCalculator()     {
         public static Date getDate (String date) throws Exception {
    //log.debug(" "+date);
              return SDF.parse(date);
    public static Date getDate (Date date) throws Exception {
    // log.debug("date is "+date);
              return getDate(SDF.format(date));
    public static long getDiffInDays(Date d1,Date d2)     {
         boolean isdiffGreaterThanYear=false;
         long diffInMilliSeconds=d1.getTime()-d2.getTime();
         return diffInMilliSeconds/(1000*60*60*24);
    public static int getYear(String date)     {
              //String[] day=     {Sun,Mon,Tue,Wed,Thu,Fri,Sat};
              Integer     year=new     Integer(date.substring(0,4));
         return year.intValue();
    public static int getMonth(String date)     {
              //String date.substring(5,7);
              System.out.println(" "+date.substring(5,8));
              String     m= date.substring(5,8);
              int month=0;
              if(m.equalsIgnoreCase("Jan"))     {
              month=1;
              if(m.equalsIgnoreCase("Feb"))     {
              month=2;
              if(m.equalsIgnoreCase("Mar"))     {
              month=3;
              if(m.equalsIgnoreCase("Apr"))     {
              month=4;
              if(m.equalsIgnoreCase("May"))     {
              month=5;
              if(m.equalsIgnoreCase("Jun"))     {
              month=6;
              if(m.equalsIgnoreCase("Jul"))     {
              month=7;
              if(m.equalsIgnoreCase("Aug"))     {
              month=8;
              if(m.equalsIgnoreCase("Sep"))     {
              month=9;
              if(m.equalsIgnoreCase("Oct"))     {
              month=10;
              if(m.equalsIgnoreCase("Nov"))     {
              month=11;
              if(m.equalsIgnoreCase("Dec"))     {
              month=12;
              return month;
         public static int getDay(String date)     {
              Integer     day=new     Integer(date.substring(9,11));
         return day.intValue();
    public static int getNumberofSundays(String d1,String d2) throws Exception     {
              //d1 is leave start date d2 is leave end date
              // get object in Date form
                   Date date1=getDate(d1);
                   Date date2=getDate(d2);
              // now get calender objects from it
              GregorianCalendar c1= new GregorianCalendar(getYear(d1),getMonth(d1),getDay(d1));
              GregorianCalendar c2= new GregorianCalendar(getYear(d2),getMonth(d2),getDay(d2));
              // get period
              long leavePeriod = getDiffInDays(date1,date2);
         return 12; // it should return number of sundays but we type 12 to perform compilation
    public static void main(String[] arg)throws Exception     {
    System.out.println(" "+getNumberofSundays("2005-Oct-07","2006-Mar-01"));
    }

    thanks now i have modified the get Month Code
    as follows
    public static int getMonth(String date)     {
              //String date.substring(5,7);
              System.out.println(" "+date.substring(5,8));
              String     m= date.substring(5,8);
              int month=0;
              if(m.equalsIgnoreCase("Jan"))     {
              month=0;
              if(m.equalsIgnoreCase("Feb"))     {
              month=1;
              if(m.equalsIgnoreCase("Mar"))     {
              month=2;
              if(m.equalsIgnoreCase("Apr"))     {
              month=3;
              if(m.equalsIgnoreCase("May"))     {
              month=4;
              if(m.equalsIgnoreCase("Jun"))     {
              month=5;
              if(m.equalsIgnoreCase("Jul"))     {
              month=6;
              if(m.equalsIgnoreCase("Aug"))     {
              month=7;
              if(m.equalsIgnoreCase("Sep"))     {
              month=8;
              if(m.equalsIgnoreCase("Oct"))     {
              month=9;
              if(m.equalsIgnoreCase("Nov"))     {
              month=10;
              if(m.equalsIgnoreCase("Dec"))     {
              month=11;
              return month;
    but question remains same how to calculate number of Sundays Between 2 Dates

Maybe you are looking for

  • Connecting a desktop computer to the Internet via the Mobile Hotspot?

    Hello, I've looked at the other postings about this but I'm still not having any luck....and I'm not really sure who to call for tech support. I can connect my laptop to the Hotspot just fine. The desktop computer is another story. I bought a Mediali

  • How do I convert a pdf file to photoshop?

    how do I convert a pdf file to photoshop?

  • Monitor lights up but no display

    I dropped my power book and broke the hinges. When I turn it on, the screen lights up and it makes the start up sound but there is no display. I tried using an external monitor which also lights up but there is still no display. When I insert the res

  • 3GS will not backup due to corrupt backup

    I PHONE 3GS , WINDOWS XP, ITUNES 10.2.2. Hi, I am trying to backup my 3gs. I receive a error message saying i have a corrupt or not compatiable backup. I have deleted the previous backup through preferences and reinstalled itunes but i still cannot g

  • Best Practice to Recreate Image?

    Hi,   I have the following image that I want to vectorized (I think this is the right term) into AI.   All I really want to do is duplicate the image or remove the the (white) background out of this picture & for the most part, will keep the object i