DETECT  NUMBER OR STRING OF I/P....PLZ  .....8={

HI
FORM
CAN SOMEBODY EXPLAIN ME WITH EXAMPLE HOW TO DETECT A I/P OBTAINED FROM A JDBC-ODBC OF EXCEL FILE READ IS A STRING OR NUMBER.
THX IN ADVANCE

Hi Form
Ok This means,I still have to parse the I/p data into a try catch situation,if exception is thrown ,then the returned data is a number else String.
ex:-
  public void (String numtoCheck){
      int test =0;
       try {
        test = Integer.parseInt("100");
      } catch (NumberFormatException nfe) {
            numtoCheck = test;
     System.out.println("------- " + numtoCheck );
So is this correct....
Thx in advance.
karthik                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

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 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

  • 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.

  • Loading a large number of strings into memory quickly

    Hello,
    I'm working on an iPhone application where I need to load a large number of strings into memory. Currently I'm simply reading from a file where each string is stored in plain text on a single line. I read the file contents into a string using stringWithContentsOfFile and then I create an NSSet object using NSSet setWithArray:[string componentsSeparatedByString:@"\n"]];
    This works like a charm but takes around 8 seconds to load on the iPhone. I'm looking for ways to speed this up. I've already tried a few things which weren't any faster:
    1) I used [NSKeyedArchiver archiveRootObject:myList toFile:appFile]; to store the NSSet data structure. Then instead of reading the text file storage. I read this file using [NSKeyedUnarchiver unarchiveObjectWithFile:appFile]; This was actually very slow and created a strings file that was about 2x the size of the original plain text.
    2) Instead of using an NSSet, I used and NSDictionary and used writeToFile and dictionaryWithContentsOfFile. This was also no faster.
    3) Finally I tried using the NSDictionary to write to a binary file format using NSPropertyListSerialization. This was also not any faster.
    I've been thinking about using SQLite instead of the flat file read, but I haven't had a chance to prototype that out to see if it would be faster. It's important that I can do fast searches for specific strings, which is why I originally used a set.
    Does any one else have any ideas how to load this into memory faster? If all else fails, I'm simply going to load the strings into memory using a separate thread on application launch so I don't prevent the user from getting to the main menu for 8 seconds.
    Thanks,
    -Keith

    I'd need to know more about what you're doing, but from what you're describing I think you should try to change your algorithm.
    For example: Instead of distributing one flat file, split your list of strings into 256 files, based on the first two hex digits of their MD5 hashes*. (Two digits might not be enough--you might need three or four. You may also want to use folders, especially if you need more than two digits.) When testing if a string exists, first calculate its MD5 hash and extract the necessary number of digits, then load that file into memory and scan its list. (You can cache these lists in memory so that you only have to load each file once--just make sure that a didReceiveMemoryWarning message will empty those caches.)
    Properly configured, SQLite may be faster than the eight second load time you talk about, especially if you ensure it indexes the column you store the strings in. But it's probably overkill for this application.
    \* A hash is a numeric code calculated from a string; on average, changing a single bit anywhere in the string should change half the bits in the hash, so even very similar strings should generate very different hashes. I suggest using MD5 instead of -\[NSString hash\] because the hash method is not guaranteed to return the same results on Mac OS and iPhone OS, or on different releases of either OS. You could also use a different algorithm, like a CRC; these are faster but I'm not as familiar with them. This thread discusses calculating MD5 hashes on iPhone OS: http://discussions.apple.com/thread.jspa?messageID=7362074
    Message was edited by: Brent Royal-Gordon

  • 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

  • Expected type [NUMBER] found [STRING] (["member"]) in function[operator@div

    Hi,
    I am trying to recalculate a figure based on an annual percentage. The script is
    FIX(yr2011, Plan, CC_4363,draft)
    "AC_&&&&&& Salary" ="AC_&&&&&&Salary"* ("pay increase%"/100)
    endfix
    endexclude
    I receive the error "expected type [NUMBER] found [STRING] (["AC_&&&&&&"]) in function[operator@div"
    I looked at this forum and someone suggested using the @match function. I tried
    "AC_&&&&&& Salary" ="AC_&&&&&& Salary"* (@match(Accounts," pay increase%")/100);
    This validated but the salary figure disappeared.
    The reason I am not loading at monthly (level zero) is due to a business requirement. I am having to spread the figures down the months from the total year but if the total year is wrong or missing the montly data obviously disappears too.
    Thanks,
    Nathan

    A few questions:
    1) I see an ENDEXCLUDE, but no starting EXCLUDE. How does that relate to the code?
    2) Do you really have member names with six ampersands in them? Is that even an allowed character? I guess it is but it looks odd as & is the character used to define the usage of an Essbase Substitution Variable. Okay, that was a comment, not a question, I guess.
    3) Do you have a Pay Increase% in every month? Or is it annual?
    3) Why don't you stick the salary value to be allocated into another Account, e.g., "Annual Salary" and place it in a single month. Then your code could look like:
    FIX(yr2011, Plan, CC_4363,draft, "Jan":"Dec")
    "AC_&&&&&& Salary" ="Annual Salary"->"BegBalance" * ("pay increase%"->"BegBalance" / 100)
    endfix
    I created a BegBalance member which you may not have -- chose Dec or Jan as your home for Annual Salary and Pay Increase and go from there. I also forced the calc to happen at the month level -- I am assuming you have months in your app, but maybe not. Salt to taste.
    Regards,
    Cameron Lackpour

  • A regular expression to detect a blank string...

    Anyone know how to write a regular expression that will detect a blank string?
    I.e., in a webservice xsd I'm adding a restriction to stop the user specifying a blank string for an element in the webservice operation call.
    But I can't figure out a regular expression that will detect an entirely blank string but that will on the other hand allow the string to contain blank spaces in the text.
    So the restriction should not allow "" or " " to be specified but will allow "Joe Bloggs" to be specified.
    I tried [^ ]* but this wont allow "Joe Bloggs" to pass.
    Any ideas?
    Thanks,
    Ruairi.

    Hi ruairiw,
    there is a shortcut for the set of whitespace chars in Java. It is the Expression *\s* which is equal to *[ \t\n\f\r\u000b]*.
    With this expression you can test whether a String consists only of whitespace chars.
    Expamle:
    String regex = "\\s*"; // the slash needs to be escaped
    // same as String regex = "[ \t\n\f\r\u000b]";
    System.out.println("".matches(regex)); // true
    System.out.println("   ".matches(regex)); // true
    System.out.println("  \r\n\t ".matches(regex)); // true
    System.out.println("\n\nTom".matches(regex)); // false
    System.out.println("   Tom Smith".matches(regex)); // falseBesh Wishes
    esprimo

  • Datatype of id columns NUMBER or STRING

    hi,
    plz tell me would it be beneficial to put the datatype of id columns as a string instead of number,,someone told me that string comparison is much faster than number column comparisons,,the reason he told me is tht comparison is done in binary form,,and to convert from string to binary is much lesser expensive than to convert from number to binary,,,the other group is saying that it has to convery string to number to binary,,,similarly number to binary,,so plz tell me what should be the datatype of id column let say values coming in it are like 001,002 etc...
    regards
    umar

    I suggest you to do the workbench. I mean, take the execution plan of both number & string values and evaluate yourself.
    Also, see the following link from the asktom site
    http://asktom.oracle.com/pls/ask/f?p=4950:8:12430422674567031403::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:3051443177514,

  • Detecting Number of Digits In An Int

    does anyone with experience in the fundamentals of java know how to detect the number of digits in an int
    i want to be able to detect the number of digits in a value recieved from a text box.
    i know i can use String.length() but i want to be able to do this in the same try block that catches a NumberFormatException after using
    int number = Integer.parseInt(s);
    thanks for any help

    i know i can use String.length() but i want to be
    able to do this in the same try block that catches a
    NumberFormatException after using
    int number = Integer.parseInt(s);What stops you from putting it there?
    Integer.toString(i).length(). Or the likes.

  • 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

  • Method to use to display (n) number of strings

    hi,
    I have a list of strings stored in an array, I need to be able to show these on screen after pressing a button. I am not sure what to use to display these, I setup an action listener on the button to create new JLabel for every string in the array which are created using a while loop, as the number cant be predefined. however by adding a new label to the panel it will only update after having left the screen and come back to it, is there another method I could use as this is obviously no good, maybe I should not use labels to display the strings. However I cannot create a preset number of labels, as the number required is unkown.
    any ideas?

    If you want the really cheap way to do it, you can use a label with multiple lines by putting <html>...</html> tags around the text and <br> between the lines. :-)
    The way we do it here though is to use a JTextArea which is formatted to look like a label.
    JLists are another way to do it, but JTextArea can wrap the lines, which JList cannot.

  • String to number and Number to String Problem!

    Hi All,
    In my report i ahve to display the Date.
    From DB i am getting 4 digit string( 2008). Using that i have to display as 08 - 09
    In that i used RIGHT function. it is diplayed as 08 - 9.
    when i take 2 character from right '08' is coming. Then i converted to number and added 1 to the year
    But it become 9 instead of 09.
    How to solve it.
    Thanks in advance.
    Saravanakumar.

    Hi,
    Shweta's answer is valid when you retrieve a date field from the database, as you have specified that you are getting a four digit string, you should use this formula.
    if length(totext(tonumber(right('2008',2))+1)) = 4
    then
    right('2008',2)'-0'left(totext(tonumber(right('2008',2))+1),1)
    else
    right('2008',2)'-'left(totext(tonumber(right('2008',2))+1),2)
    hope this helps!!!
    Thanks
    -Azhar
    Edited by: Abdul Rehman Mushtaque on Mar 29, 2009 10:29 AM

  • Detect substring in string

    Hi all,
    I am new to ABAP and hoping you guys can let me know if there is a better way to check for a substring in a string.
    I need to detect a substring (or should call it a word) 'CNF' in a string, and it need to be a word itself and not part of another word (example, PCNF). This substring can appear in the beginning of the string or the end of the string. To explain this clearly let me show you a list of string that should return me true or false:
    Return true:
    MCNF CNF REL
    CNF MCNF REL
    CNF REL
    REL CNF
    MCNF REL CNF
    Return false:
    MCNF PCNF REL
    REL MCNF PCNF
    One way i think of doing it is to split it using space into a itab, loop thru and check. Is there a better way to do this?

    Hello,
    Please look at the example below:
    Example
    DATA F(50).
    MOVE 'Alaska Texas California' TO F.
    SEARCH F FOR 'Clfrn' ABBREVIATED.
    Here, SY-SUBRC is set to 0, since not only does the string 'Clfrn' occur (separated by other characters) in 'California', but 'Clfrn' and 'California' begin with the same letter.
    Addition 2
    ... STARTING AT n1
    Effect
    Searches the field f starting from the position n1. Here, n1 can also be a field containing the corresponding value. The first character in the field f is in position 1.
    When you use the addition STARTING AT, the position specified for the found pattern in SY-FDPOS does not refer to the start of the field, but to the position n1.
    Addition 3
    ... ENDING AT n2
    Effect
    Searches the field f up to the position n2.
    Addition 4
    ... AND MARK
    Effect
    If the search string g is found, all the characters of the search string and all the characters occurring in between (in the case of SEARCH ABBREVIATED) are converted to upper case in the field f.
    Example
    DATA F(20) VALUE 'Peter Paul Mary'.
    SEARCH F FOR '*UL' AND MARK.
    SY-SUBRC is now set to 0, since the search string was found in 'Paul'. SY-FDPOS has the value 6, since the character string found starts at the offset 6. Also, the search string is marked, so that the new contents of f are as follows:
    'Peter PAUL Mary'
    Hope this helps...
    P.S. Please award points for useful answers.

Maybe you are looking for

  • LOVs in the param screen not displaying in ora10g(9.0.4)

    Hello, Development is in linux. deployment in windows. when i compile .rep paramscreen is not displayed correctly. LOV columns with SQL is not with dropdown. I need help to overcome this. V.Parandaman

  • Exposing complete data structure in webservice

    Hello Experts,   I have a scenario where a Bapi functionality(server proxy) is exposed as a webservice . So scenario will be SOAP -> XI -> Proxy (calls a BAPI) In our BAPI (proxy, target structure) we are having 100+ fields. Currently the WS consumer

  • A day in the life of a collge intern

    I'm working alone on a project for a company that required that I learn java. Java in and of itself isn't that difficult to pick up. However, one problem that i've run into is that I'm trying to run video through a program that requires me to program

  • JSP + Struts2

    Hello, I'm in a new project that needs to be in JSP. I'm using JSP + Struts2, do you guys think its good? Whats the best and the the most recent technologies to use with JSP? I'm having a problem when passing JSP parameters values to Java Classes in

  • Why won't my final cut 7 export my entire :30 movie in pro res 422 60i

    Why won't my final cut 7 export my entire :30 movie in pro res 422 60i? And some transitions are not rendering properly.