Extract the numbers in string using regex

Hi,
How to extract the numers in string using regex?.
Already i tried split up the string using [\\s]
For ex: "Uting Tatk and Window Panet 15"
it gives the ans 15.
if the string is
For ex: "Uting Tatk and Window Panet 15 New!"
i can't find the number.
so plz give me some idea to get the number frm String.
Thanks

I am developing a java project to extract Table of
content in a particular
PDF.
i extracted all topics.
then i want 2 extract page number from dat extracted
TOC.
if the TOC ends with number then i can easily find
out the number
but in vain if the TOC ends with like this
"Uting Tatk and Window Panet 15 New!".
i could n't find the page number.What will you do if it says:
"15 ways to find topics 42 new"

Similar Messages

  • How To Color a Text string using Regex (java.util.regex)

    Hello,
    How can I color a text string using regex class in 1.4?

    Yes, did you notice it said something about incredibly vague functionality?
    Let me break it down for you
    > How can I color a text string
    Strings do not have color... You can color a component (a label, a button), but you can't color a string
    > using regex class in 1.4?
    Using a regular expression? How would a regular exression color anything? Do you have embedded color codes? Are you searhing a string for some secret word?
    What are you talking about?

  • Is it possible to extract the text and images using PHP

    Hi friends,
    Is it possible to extract the text and images using PHP, in the same order as it is in the PDF?
    Else is it possible extract the same as XML using PHP, or ASP
    I googled it but its in vain, any help is appreciated.
    Thanks in advance.

    Dear Mike,
    Thanks for your quick reply,
    I mean is it possible to parse the PDF line by line using the PHP.
    I extracted the whole text but couldn't the images. Since the PDF's images are decoded using various methods like DCTDecode, JPXDecode, etc.
    The text is decoded with FlateDecode, which i breaked using a function in PHP.
    Thanks,

  • How to extract the number from image using java

    Hello every one
    i want to develope a project which can extract the number from image
    that i can use as inter or String or char.
    Is there any API in java which provide this type of facility.
    right now i m using java 5
    thanks in Advance
    Jignesh

    In my project i have a image in that i have a
    co-ordinate (x,y) I am still puzzled as to what you seek. It sounds to me like you have a point (x, y) represented by p. in java it's just p.getX() p.getY()
    i want to convert that cordinate to numeric form,
    i mena i want to use that cordinate in somewhere else
    in project.point.getX() point.getY()
    So need to convert it into numeric form u can called
    it OCR also.OCR is optical character recognition. If I want out and took a picture of the US Declaration of Independence and then wanted the words on the parchement in the picture in text form, then I would run the picture through a software program and it would try to optically recognise what lettering and number were present in the picture. In the end, I would have a text of what is written on the US Declaration of Independence.
    Is that what you want?

  • How to extract the Datetime from string?

    Hello FOlks,
    I have the sample data whichi is a string and it contains DateTime part inside it. I worked through half way but am not sure how to get the other part.
    The sample data is
    Note Added by AARON HILTON at 05/26/2010 14:53 MONEY NOTE ENTERED
    Note Added by DEBBIE BILL at 11/16/2009 23:12 MONEY ENTERED
    I tried using
    substr(d.assignee_note, INSTR(d.assignee_note,'at')+2,length(d.assignee_note))  but it did not have the desired results.
    How to just extract the datetime part i.e. 11/16/2009 23:12

    If your sample data is representative for all the data, you could also try a regular expression:
    SQL> -- generating sample data, pretending it's stored in a column called str in a table called t:
    SQL> with t as (
      2  select 'Note Added by AARON HILTON at 05/26/2010 14:53 MONEY NOTE ENTERED' str from dual union
      3  select 'Note Added by DEBBIE BILL at 11/16/2009 23:12 MONEY ENTERED' from dual
      4  )
      5  --
      6  -- actual query:
      7  --
      8  select trim(regexp_replace(str, '[[:alpha:]]')) str
      9  ,      to_date(trim(regexp_replace(str, '[[:alpha:]]')), 'mm-dd-yyyy hh24:mi') dt
    10  ,      to_timestamp(trim(regexp_replace(str, '[[:alpha:]]')), 'mm-dd-yyyy hh24:mi') ts
    11  from   t;
    STR                DT                        TS
    05/26/2010 14:53   26-05-2010 14:53:00       26-05-10 14:53:00.000000000
    11/16/2009 23:12   16-11-2009 23:12:00       16-11-09 23:12:00.000000000
    2 rows selected.where column STR is, well, a string, DT will turn your string into date datatype and TS will turn it into a timestamp.
    It isn't clear how you want to extract the datetime part, but it really matters...

  • Extraction of Numbers from string in oracle

    Dear All,
    I have a AplhaNumeric field in my source table which holds the string with numbers and caharcters .i need to extract only numbers and to load into the target table which of number type.
    can any one suggest me about how to do this?
    regards
    kumar

    Hi ,
    I have a table called smitems with column smitmqtyremarks which holds alpha numeric characters .nearly 180 records exists in this table.
    i need extract numbers for this field and load into my target tables.
    here i am giving sample rows for this field :
    smitmqtyremarks
    13 قطعة
    4 لحاف
    31 قطعة
    120 قطعة
    57 قطعة
    110 قطعة
    127قطعة
    169 قطعة
    12 مفرش
    10 مفارش
    110 قطعة
    170 قطعة
    20 خرطوشة
    28 قطعة
    60قطعة
    70 قطعة
    80 لعبة
    70 قطعة
    20 قطعة
    60 قطعة
    50 قطعة
    10 رولات
    4 رولات
    35 دسته
    50دستة
    7 رول
    3 اثواب قماش
    خمسة خرطوشة سجائر
    50 جاكت حريمى ورجالى
    10 رول اقمشة 4 دسته
    420 جوارب اطفال
    60 خرطوشة سجائر
    12 رول
    15 خرطوشة
    110 علبة
    45 قطعة
    40 قطعة
    44 قطعة
    22 قطعة
    3 خرطوشة
    468 قطعة
    38 قطعة
    80 رول قماش
    2 رول
    6 رول اقمشة
    13 رول اجنبى الصنع
    100 دسته صينى الصنع
    18 رولات ملابس
    10دسته
    90قطعة
    33 قطعة
    39 قطعة
    42 قطعة
    300 ايشارب
    500 قطعة
    19000 ك 0ج
    607 قطعة
    24 قطعة
    45 قطعة
    40 اروسه
    5 رول اقمشة اجنبية الصنع
    75 قطعة
    5 قطعة
    4 رول
    26 قطعة
    50قطعة
    105 قطعة
    650 جرام
    65 قطعة
    50 خرطوشة
    4 خرطوشة
    80 قطعة
    100 بنطلون
    500 قطعة
    40 قطعة
    42قطعة
    1 خرطوشة
    14 قطعة
    80 قطعة
    7 خرطوشة سجائر
    230 لمبة
    50 قطعة
    50قطعة تليفون
    14 كرتونة
    4 كرتونة احذية
    17 كرتونة خزف
    22 لحاف
    16كرتونة ادوات صحية
    8كرتونة
    28 كرتونة
    2كرتونة
    15كرتونة
    115 قطعة
    6448
    1937قطعة
    1937 قطعة
    2628كجم
    6.980طن
    9 كرتونة
    18 شفاط
    صواميل حديد
    3كرتونة +20 قطعة
    39.480طن ق.غ سيارات
    25كرتونة مصنوعات خزفية
    50بنطلون
    8 كرتونة كلبسات
    20كرتونة اكسسوار حريمى
    279كرتونة لحوم
    38 اطار كاوتش
    10كرتونة
    4كرتونة
    10كيلو
    عدد5 ماكينات
    41سيارة
    سيارة
    90 قطعة ملابس
    22250كجم
    1793كجم
    1371كرتونة زجاج
    مستندى
    252شاشة
    5كرتونة
    320قطعة
    45خرطوشة
    98 قطعة
    10لفات
    25كجم
    320كجم
    5كراتين
    47طرد
    50قطعة
    117كجم
    1200 قطعة ملابس
    5كجم
    75جهاز
    40قطعة
    5كراتين
    10كجم
    250ق
    200ق
    200 توب
    20لفة
    30لفة
    2دستة
    95قطعة
    70قطعة
    57523طن طلمبات مياه
    43732كجم
    755كرتونة
    10.645طن
    1537طرد
    11751كجم
    مكبس
    77426.80متر
    2600قطعة
    339طن
    15120كجم
    مختلفة
    267طرد
    1200كجم
    189عبوة
    499كرتونة
    10000كجم
    960طرد
    15.770كجم
    111قطعة
    174طرد
    22000كجم
    473000علبة
    6720كجم
    145خرطوشة
    2500طن
    3660كجم
    27824كجم
    8682كجم
    14000كجم
    6400كجم
    133كرتونة
    2738كجم
    the characters are in arabic here.
    hope it clears my issue.
    please suggest me the right query for this to get only numbers
    thanks
    kumar

  • Extract the data from URL using XI

    Hi,
    Please let me know if  you have idea  about this:
    Scenario is:
    1. We are extracting some raw data (strings) from one url(http) using java program ...
    2. After extracting the data , some parsers making the XML files for that.
    Now my question is :
    Will able to add these javacalsses(java program) into XI for trigger the messages from url?
    It means I need to call url through XI and make the xml for that. After getting XML we need to map RFC for process the messages into ZTable.
    I didn't get idea about  how to make call for url through XI. It would be appreciated for sharing your expereince on this..
    Regards...Raj!

    Hi,
    >>>>Will able to add these javacalsses(java program) into XI for trigger the messages from url?
    yes you can do it all in a java proxy
    you just have to invoke a java proxy
    and inside you can put any java code you wish
    then you can use the parser and fill the xml message
    >>>>It means I need to call url through XI and make the xml for that. After getting XML we need to map RFC for process the messages into ZTable.
    then you can map your xml message to an rfc format
    if you have the java classes that access
    the url this will be very easy with a java proxy
    for more:
    https://websmp206.sap-ag.de/~sapdownload/011000358700000877852006E/HowToWorkWithJavaProxies.pdf
    Regards,
    michal

  • How to extract the data from SAP using Msaccess tool ?

    Hi Experts,
    Purpose u2013
    Want to extract the data in a better way rather than using the T.code u2013 SE16
    regards
    Kedar Kulkarni

    Hi,
    Try this...
    Please use the standard ABAP program "RIACCESS".
    Before using the program "RIACCESS", you need to install the PS utilities, which are part of SAPGUI install CD.
    It is available in the "\SAPGUI\PS directory". 
    Then do the followings :
    1. Select transaction code SALE -> Systems in network-> Define RFC Destination. 
    2. You will need two RFC destinations (TCP/IP connections for the front-end workstation). 
         Setup the two RFC destinations PS_ACCESS_1 and PS_ACCESS_2 and you'll have to get them to point to wdpsastr.exe and wdpsatab.exe respectively. 
    3. Then execute RIACCESS and choose PS_ACCESS_1 to generate access tables. 
    The system must also be able to access the RFC-DLL files (librfc2.dll, librfc3.dll, librfc4.dll, librfc5.dll, librfc6.dll, vrfc.dll). 
    Please note that Access only supports tables with up to 255 fields.

  • Can we eliminate " from a String using regEx?

    Hi,
    I have a process and we are calling an external web service.
    Within code, I am setting the response from web service(string) to bpm object and using the same object in jsp for presentation.
    For Ex.
    bpmObject.empName = response from web service.
    within the jsp, have a java script where in I am validating the value.
    var empNm= "<f:fieldValue att="bpmObject.empName" onlyValue="true"/>";
    It works fine but some times when response from web service is having '"' - double quote, it is giving error.
    For Ex. bpmObject.empName = FirstName "SecondName" then the javascript error occurs. how can we remove the double quote from this?
    Tried bpmObject.empName.replace(from : "\"", @to : " ") but it is still giving the same output FirstName "SecondName"
    It works fine when I test by using a String str = "FirstName\"SecondName\"".replace(from : "\"", @to : " ") is giving correct result i.e. FirstName SecondName
    Can RegEx help in this?
    Thanks

    I know its better to handle in jsp/javascript
    var empNm= "<f:fieldValue att="bpmObject.empName" onlyValue="true"/>";
    but the above line is giving javascript error always.
    how to handle the same in bpm fpr code?
    Edited by: Sreekant on Mar 3, 2011 1:44 AM

  • Extract the table formated data using itextsharp in c#

    I have one pdf file in which i need to extract table formated data in a specific format by each filed.I tried by using itextsharp but data comes in unspecified format. Can any one help me on this.This is very useful for me.
    please find attchement for pdf and their fields
    Field Name(as per RRC Records or wildcat): Block A-34(SAN ANDRES)
    LEASE NAME: SIGHT FOR SORE EYES
    OPERATOR'S NAME: RING ENERGY, INC.
    API No:42-003-39809
    like wise all fileds.

    Hello Manideep Lakkakula,
    As ITextSharp is a library from here
    http://sourceforge.net/projects/itextsharp/ and also PDF is third party product, I'm afraid you have to post on specific forum about ITextSharp library instead of here. C# is just a language forum.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Change Start page numbering to Auto Page numbering in the Numbering & Section Options using script

    1.  I have many documents to add into a book. After adding the documents, all file page numbers should be continued from the previous file. Now I am doing manually for all files at all time. Numbering & Section Options => Start Page Numbering at: to Automatic Page Numbering.
    2. And also I need to add the Chapter number with the page number (Ex: 1/2, 1/3, 1/4 … , 2/2, 2/3, 2/4 …., 3/2, 3/3, 3/4 ….). Here also I am doing manually like.  Numbering & Section Options => Page Numbering => Section Prefix: 1 and Include Prefix When Numbering Pages. (The page number should start from 2).
    Note: In Every chapter opening there will be a file name called S… (Ex: Ch 1: S3391.indd, Ch 2: S3392.indd, Ch 3: S3393.indd). So after every S(S3391, S3392 …) file the next file page number should starts from 1/2, 1/3. 2/2, 2/2 ….
    Ex:
    Chapter 1          Pages
    S3391.indd     
    32457.indd       1/2  … 1/5
    32617.indd       1/6 ….. 1/9
    32217.indd       1/10 … 1/13
    Chapter 2
    S3392.indd
    42457.indd       2/2  … 2/3
    52617.indd       2/4 ….. 2/9
    33217.indd       2/10 … 2/13
    Could anyone give me an idea or script, please? At least for First one, could anyone suggest me ASAP.
    P.S: I have some more questions regarding this, I will post that after some time...
    Thanks in Advance,
    Thiru

    var openedDocs = app.documents;
    var chapterPrefix = prompt ("Enter the chapter prefix", "1/", "Prefix");
    for (var doc=0; doc<openedDocs.length; doc++){
        openedDocs[doc].sections[0].continueNumbering = true;
        openedDocs[doc].sections[0].sectionPrefix = chapterPrefix;
        openedDocs[doc].sections[0].includeSectionPrefix = true;
    alert("Done");
    Chapter 1, contains 10 files (Each file 6 pages)… (1/1, 1/2, … 1/60) – prefix 1
    Open all 10 files of one chapter and run it....
    and then for another 10 files....

  • Extracting the xml from string and parse it

    Hi all,
    I have a webservice, and calling one of the methods, returns xml data but store this data in a string.
    For example:
    String str = keysstub.getUserLMLArray(UserID,hash, Provider, Filter.ALL,TimeStampString).getXmlResults();returns <id>123456</id><id>123457</id><id>123458</id><id>123459</id><id>123461</id>and stores it in str.
    I have to take read this xml from the string and parse it accordingly to retreive the data from it.
    Please suggest how i can parse this xml from the string. it will be of great help. Code snippets from anyone would be of great help
    Thanks and Regards,
    Shikha

          * Get DOM document from a string containing valid XML.
          * @param string String to read XML content from.
         * @param varargs Optional arguments: 1: Validating?, 2: NamespaceAware?
          * @return DOM document or null if failed.
         * @throws Exception if failed.
         static public Document toDocument(String string, boolean... varargs) throws Exception {
            Document result = null;
            if (string != null) {
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                if (varargs != null && varargs.length > 0) {
                    int count = varargs.length;
                    if (count > 0) {
                        factory.setValidating(varargs[0]);  //needs error handler
                    if (count > 1) {
                        factory.setNamespaceAware(varargs[1]);
                DocumentBuilder db = factory.newDocumentBuilder();
                result = db.parse(new InputSource(new StringReader(string)));
            }//else: input unavailable
            return result;
        }//toDocument()and don't forget that the string must be valid xml, so in your example the header is missing and the first element must embrace all subsequent elements, e.g.
    <?xml version="1.0"?>
    <ids>
    <id>123456</id><id>123457</id><id>123458</id><id>123459</id><id>123461</id>
    </ids>

  • Is there a way to get the actual XML string when using the JAXP SAX Parser?

    Hi All,
    I am using a JAXP SAX xml parser and am looking for a way to get the actual line of xml that is being parsed from within a content handler.
    Here's my scenario. Consider the following example xml document.
    <formCollection>
       <form name="myForm">
          <text/>
          <selection/>
       </form>
       <form name="anotherForm">
          <text/>
       </form>
    </formCollection>My hope is to validate the entire document and then insert an xml string containing each "form" element (and its sub-elements) into a map for later use. My thought was to create a String as each "form" element is being parsed (begining with the form's startElement event and concatenating until the form's endElement event is reached) and then inserting this string into the map. Is there a way to get the actual line of xml that is being parsed, rather than just the element name and attribute values?

    DrClap wrote:
    YouRang wrote:
    2. The first handler would validate the entire XML document, extract the "type" attribute from each <form> element, and place each <form> element and its sub-elements into the map of Strings, using the "type" attribute as the key. The second handler would take a <form> element and parse it into a Form object for the display. This option was the impetus for my question because it relies on the first handler being able to access the entire <form> element XML String and write it to a map.I don't see why you need the raw data from the XML document here. You should already be abstracting your data into Java classes in the first handler, instead of making the second handler do the parsing all over again.Correct, I am not referring to XForms. In this case, it happens that I am using the XML to generate an SWT ScrolledForm object and, thus, the XML element name happens to be named "form." However, the concept/design problem could apply to any type of object and the XML element could be appropriately renamed.
    My experience with XSLT is limited and I haven't done anything with it for several years. With that said, it seems that it is primarily used for generating web content, which wouldn't apply in this case because this is for a client-server application. I could be off base on this one -- if XSLT applies to much broader translations and would be more appropriate for generating Java objects than my current methodology, I could certainly look into it further.
    I apologize that option two didn't make more sense; it is difficult to explain. Yes, optimally the data should be abstracted into Java classes in the first handler. This is really an elaboration that I failed to specify when explaining option one. The problem is that the user can choose to create any number of "forms" of any type. For instance, let's say that from the File -> New menu there are options for seven different types of forms and each form is used to send completely different data. The user can select form1, select form1 again, select form4, and select form7 (or any other combination) and bring up tabs that display the different forms. The user can then enter data and submit each form separately. When the user selects File -> New -> FormX, a SWT ScrolledForm object that corresponds with FormX must be given to the display. Because SWT ScrolledForm objects do not allow a deep copy, I cannot simply read the XML <form> elements at initialization, parse them into ScrolledForm objects, and pass deep copies of the ScrolledForm objects to the display each time the user clicks File -> New -> FormX. The only simple way I see of getting a new copy of a ScrolledForm object is to reparse the appropriate XML <form> element in order to create one each time the user selects File -> New -> FormX. As such, one handler would need to read the entire XML document and parse the <form> elements into a map (or some other data structure) and another handler would need to parse individual <form> elements into SWT ScrolledForm objects. The first handler would be called at initialization and the second handler would be called each time a user clicked on File -> New -> FormX. Once again, this isn't exactly my favorite implementation... but seems the simplest given that there is no way to do a deep copy of an SWT ScrolledForm object. Hopefully that makes a little more sense. No worries if it doesn't -- I just figured I'd throw this out there and see if anyone had a better idea.

  • Extracting the RGB value using getPixelColor

    I am hoping someone out there can tell me how to extract the numbers from what is returned by the getPixelColour method in the Robot class. At the moment this line :
    robColor9 = myRob.getPixelColor(x-1, y+1);
    of Code returns this ouput:
    java.awt.Color[r=4,g=38,b=150]
    mrRob being an object of class Robot and robColor being the variable the color is being stored in.
    what i would like is the RGB value not the gumpf before it i.e java.awt.Colour, but just r=4,g=36,b=150.
    if someone could help that would be of great help.

    What you get is an instance of java.awt.Color. In this class you find the methods getRed(), getGreen() and getBlue().

  • Reading or Extracting the content of an Email if it is sent by the client.

    Dear All,
    Is it possible to read an Email message and extract the data from that using JSP, like what we use in request.getParameter().
    Also, Is it possible to submit a form when an Email is sent.
    I send an HTML formatted Email to my client and if he keen the data and sends the mail, will it be possible to extract the values he keened in the email thru JSP.
    Yours,
    Sankar.B

    Do you mean that you want some Java code to run when an e-mail is sent to a certain address?
    If so, set up a mail account to receive the mail. Then you can access the mail using the JavaMail API (using either the POP3 or IMAP protocol). The Java code that reads the mails can do anything with the content, and reply to the e-mail.

Maybe you are looking for