Getting text between two tag

Hello,
what would be the best method to implement to get text between
two tags,
eg <TEST1> this is a test </TEST1>
as in; this is a test,
i try to use BreakIterator, but it skip the tags,
when i do word by word loop

this is one way:
        String string = "<TEXT>This is the middle text</TEXT>";
        String x = string.substring(string.indexOf("<TEXT>") + "<TEXT>".length(), string.indexOf("</TEXT>"));

Similar Messages

  • Getting text between two special characters as a new line

    Hi all ,
    I hope some one can point me in the right direction or tell me if its possible or if there is a function that can do this in tsql. I have table with two fields in a table ORDERNUM,NARRATIVE. The values in the NARRATIVE field are some what like this (they
    come from a flat while and are delimited by a "^"). The examples are like :
    OREDERNUM NARRATIVE
    1234           ^Parcel shipped^picked^entry passed then returned back^white ford truck number 78455333^freight charges entered^parcel weight entered^parcel supervised^ticketsscannned^broken glass on
    floor^
    what i want to is seperate the text between the "^" as new line like
    1234 parcel shipped
    1234 picked
    1234 entry passed then returned back
    1234 white ford truck number 78455333
    Can anyone please help me, is there a way or can any one show me what function does this? SUBSTRING for sure is not an answer as there is no fixed length for this.
    Thanks
    SV

    CASE_NUMBER NARRATIVE
    000000GA ^000000G-A CHIEF OF POLICE 02-02-95 PGE 1^***BATCH RUN COPY***^INCIDENT: MOLEST OTHER^LOCATION: 00416 N COLORADO AV OTHER:^EI20^ATTENTION:^ SEX OFFENSE^NOTIFIED: 02-01-95 2300 HRS BY: OTHER INVEST 02-01-95 2305 HRS^ARRESTS: 00 INJURED: 00 DEAD: 00 VEH TOWED: 00 BEAT: B51^^PERSON 01^VICTIM-PERSON^STEVE WOOLBRIGHT NH/W/M/14/08-31-80^SUBPEONA: N^ADDRESS: 00416 N COLORADO AV^HOME-PHONE: 322-9249^^^NARRATIVE:^REPORT MADE FROM STATE 310 REPORT STATING ABOVE-LISTED SUBJECT^HAS BEEN SEXUALLY MOLESTED. INVESTIGATION REQUESTED.^^4725 POPCHEFF A P4687^^02-01-95 2025 HRS - WILDER EULA W3163 TAPE:02^^ 95.033 00:23-END OF REPORT-95.033 00:26^^^
    000718GB ^000718G-B ADDITION CHIEF OF POLICE 08-08-95 PGE 1^***BATCH RUN COPY***^INCIDENT: RECOVERED STOL. VEH PUBLIC STREET-ALLEY^LOCATION: PLAINFIELD,IN OTHER:^OCCURED: 04-01-93 TIME UNKNOWN EO11^ATTENTION:^ AUTO DESK AUTO THEFT WEST DISTRICT^NOTIFIED: 08-07-95 1600 HRS BY: OTHER INVEST 08-07-95 1600 HRS^ARRESTS: 00 INJURED: 00 DEAD: 00 VEH TOWED: 00 BEAT: OJ^^PERSON 01^OWNER/OPERATOR^DAVID FURMAN NH/W/M/ 08-20-57^DRIVERS LICENSE/SSN: 310702334^ADDRESS: 02495 AVON RD PLAINFIELD IN^HOME-PHONE: 838-0467^^^VEHICLE 01^PICKUP^BLACK 91 FORD F350 2DR^VIN: 2FTJW35G6MCA99397^DISPOSITION: RECOVERED^COMMENTS: OWNER RECOVERED VEHICLE IN 1993^^NARRATIVE:^ON 08/07/95, I RECEIVED A PHONE CALL FROM JAMES BEARD OF THE^^ -CONTINUED-^
    000718GB ^000718G-B ADDITION CHIEF OF POLICE 08-08-95 PGE 2^^NATIONAL INSURANCE CRIME BUREAU WHO STATED HE WAS DOING A^CHECK OF HIS RECORDS AND CAME ACROSS A VEHICLE THAT WAS^STOLEN ON 04/24/92, UNDER IPD CASE #00718GA. HE STATED HE HAD^SPOKEN TO THE INSURANCE COMPANY ON THIS CASE AND THEY STATED^THEY HAD PAID OFF ON THE VEHICLE AND SOLD THE VEHICLE BACK TO^THE OWNER. APPARENTLY THE PERSON REPORTING THE EVENT, DAVID^FURMAN, REPORTED HIS VEHICLE STOLEN ON 04/24/92, APPROXIMATELY^1 YEAR LATER HE WAS CONTACTED BY AN UNIDENTIFIED PERSON AND^TOLD HIM TO MEET HIM ON A CORNER IN THE INDIANAPOLIS AREA AND TO^GIVE THE MAN $5,000.00 AND HE WOULD GIVE HIM HIS TRUCK BACK.^MR. FURMAN HAD ALREADY BEEN PAID BY THE INSURANCE COMPANY^APPROXIMATELY $31,000.00 IN RESTITUTION FOR HIS VEHICLE.^MR. FURMAN THEN WENT TO THIS CORNER LOT AND MET WITH THIS^UNIDENTIFIED W/M AND PAID HIM $5,000 CASH. THE MAN THEN TURNED^THE 1991 PICKUP TRUCK OVER TO MR. FURMAN. MR. FURMAN THEN^SETTLED WITH THE INSURANCE COMPANY AND PAID THEM $19,000.00 AND^BOUGHT THE VEHICLE BACK FROM THE INSURANCE COMPANY AND IT IS^NOW TITLED TO HIM AND REGISTERED TO HIM. HOWEVER, AT NO^POINT DID MR. FURMAN OR THE INSURANCE COMPANY CONTACT THE^POLICE DEPARTMENT TO TAKE THE VEHICLE OUT OF THE SYSTEM AS^BEING STOLEN. THAT IS THE REASON FOR THE REPORT. THE VEHICLE^SHOULD BE REPORTED AS A RECOVERED AND RELEASED TO OWNER. DAMAGE^UNKNOWN.^^^^ -CONTINUED-^
    select TOP 214
    CASE_NUMBER,
    splitdata
    from
    SELECT F1.CASE_NUMBER,
    O.splitdata
    FROM
    SELECT *,
    cast('<X>'+replace(F.NARRATIVE,'^','</X><X>')+'</X>' as XML) as xmlfilter from [dbo].[CECASRPT] F
    )F1
    CROSS APPLY
    SELECT fdata.D.value('.','varchar(5000)') as splitdata
    FROM f1.xmlfilter.nodes('X') as fdata(D)) O
    )t
    where t.splitdata <> ''
    SV

  • How can I remove all content between two tags using Find/Replace regular expressions?

    This one is driving me bonkers...  I'm relatively new to regular expressions, but I'm trying to get Dreamweaver to remove all content between two tags in an XML document.  For example, let's say I have the following XML:
    <custom>
    <![CDATA[<p>Some text</p>
    <p>Some more text</p>]]>
    </custom>
    I'd like to do a Find/Replace that produces:
    <custom>
    </custom>
    In essence, I'd like to strip all of the content between two tags.  Ideally, I'd like to know how to strip the CDATA content as well, to return the following:
    <custom>
    <![CDATA[]]>
    </custom>
    I'd much appreciate any suggestions on accomplishing this.
    Many thanks!

    Thanks much for your response.  I found David's article to be a little thin with respect to examples using quantifiers in coordination with the wildcard metacharacters; however, I was able to cobble together a working expression through trial and error using the information he presented.  For posterity, here’s the solution:
    Find:
    <custom>[\d\D]*?</custom>
    Replace:
    <custom>
    <![CDATA[]]>
    </custom>
    I believe this literally translates to:
    [] = find anything in this range/character class
    \d = find any digit character (i.e. any number)
    \D = find any non-digit character (i.e. anything except numbers)
    *? = match zero or more times, but as few times as possible (i.e. match multiple characters per instance, but only match one instance at a time, or none at all)
    I’m still not sure how to effectively utilize the . wildcard.  For example, the following expression will not find content that ends with a number:
    <custom>.*?[\D]*?</ custom >
    I'm presuming this is because numbers aren't included in the \D metacharacter; however, shouldn't numbers be picked up by the .*? expression?

  • How to get relationship between two  views in the  reports

    How to get relationship between two  views in the  reports, I am doing a deletion program , it is fully relates to views , how to get relationship between them in the reports

    Hi,
    Please explain your question in detail...what do you want to read ?
    If you want to know about the navigation links between the views then you can use APIs  like
    wdComponentAPI.getComponentInfo().findInWindows("windowName").getViewUsageByID("Name").getNavigationLinks();
    Iterate through the navigationLinkInfo from above collection and can read the other properties .
    I haven't tried the above , but it should work !!!
    Regards,Anilkumar

  • How can i get report between two dates?

    Hi
    how can i get report between two dates?
    for example i want get reports between 20/4/2002 & 27/4/2002.
    my table has date column and i can get first date( exam : .... where date:=a and/or ....i don't know this part)
    thanks alot.
    Regards
    The Oracle Reports Team
    http://otn.oracle.com/

    where exam_date between :from_date and :to_date
    from_date and to_date are user_parameter

  • How to get space between two values in a single cell of a table.

    hello,
            how to get space between two values in a single cell of a table.
    thanks a lot.
    kailash.

    sorry i got the answer.

  • [Help] Get Text Between words!

    Hi,
    I wanna to Get Text Between words,
    I'm tring to something like this , can anyone help please ?
    <?php
    $data = "<a target='_blank' href='http://www.mysite'>Engineering</a><des>Description</des>
             <a target='_blank' href='http://www.mysite'>Accountant</a><des>Description</des>";
    // Define Pattern
    $linkS = "href='";    $linkE = "'>";
    $titleS = "<link>";    $titleE = "</link>";
    $desS = "<des>'";    $desE = "</des>";
    //Get Text in the between
    preg_match("/{$linkS}([^`]*?){$linkE}/", $data, $temp);
    //First Group
    $link1 = $temp['1'];
    $title1 = $temp['1'];
    $des1 = $temp['1'];
    //Second Group
    $link2 = $temp['2'];
    $title2 = $temp['2'];
    $des2 = $temp['2'];
    //Third Group
    //and so on
    $Link1= strip_tags($link1);
    $Link2= strip_tags($link2);
    echo $Link1;
    echo $Link2;
    ?>

    Hi,
    Check the following link:
    http://www.sap-img.com/sapscripts/sample-sapscripts-label-printing-program.htm
    you will get one sample program of sample label pring program.
    hope it help you.
    Regards,
    Bhaskar

  • Best way to get internet between two buildings???

    Hello all! I have some questions about a possible setup I am thinking of running.
    I have building that has internet coming into it. 15yds away, I have another building (which is brick) that has no internet options. I was thinking about buying two Airport Extreme's, making one the base and using the other one in the other building the access point for WDS. Then buy a couple of the Airport Expresses to push the signal throughout that building.
    Thoughts on this? Is there a better way to get internet between two buildings (without running cables) and then push it through out that building?
    I am open to any an all suggestions.
    Thanks,
    Grant

    Welcome to the discussions!
    Ethernet is always the best choice for signal strength and reliability. If you do not want to run ethernet cable to the second building, your options are down to ethernet powerline adapters and wireless.
    The ethernet powerline adapters work by transmitting the ethernet signal over the AC power line. The difficulty here may be that the other building is on a different electrical circuit, so it may or may not work depending on how the electrical wiring is configured. An electrician could run tests to see if this would work.
    The least reliable option is wireless. To have the best chance of working well, the "sending" and "receiving" routers need to be able to "see" each other through a window or other opening. Be sure to test with a laptop in the second location to see if you will have a strong enough signal to work with before you go this route.

  • How to selecting everythings between two tag

    Hi,
    Using Find and Replace tool, i need to select everything
    between two tag. Example:
    I have:
    <owntag><p>Important Note: These online forums
    are for user-to-user discussions of Adobe products, and are not an
    official customer etc etc<p></owntag>
    I need to select:
    <p>Important Note: These online forums are for
    user-to-user discussions of Adobe products, and are not an official
    customer etc etc</p>
    I have to do this in many pages... and every page has same
    tag.. for example <owntag> </owntag>. Don't matter what
    there is between the tag, i wish to select everything after the
    <owntag> and before </owntag>
    Pls can u tell how can i do this??
    Tnx very much =)

    What exactly is <owntag>?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Dylan1980" <[email protected]> wrote in
    message
    news:go63sv$5d0$[email protected]..
    > Hi,
    > Using Find and Replace tool, i need to select everything
    between two tag.
    > Example:
    >
    > I have:
    >
    > <owntag><p>Important Note: These online
    forums are for user-to-user
    > discussions of Adobe products, and are not an official
    customer etc
    > etc<p></owntag>
    >
    > I need to select:
    >
    > <p>Important Note: These online forums are for
    user-to-user discussions of
    > Adobe products, and are not an official customer etc
    etc</p>
    >
    > I have to do this in many pages... and every page has
    same tag.. for
    > example
    > <owntag> </owntag>. Don't matter what there
    is between the tag, i wish to
    > select everything after the <owntag> and before
    </owntag>
    >
    >
    > Pls can u tell how can i do this??
    >
    > Tnx very much =)
    >

  • How to get days between two dates

    Hi ,
    How to get days between two dates.
    Regards,
    Ramesh.

    Hi Ramesh,
    REPORT ZDATEDIFF.
    DATA: EDAYS   LIKE VTBBEWE-ATAGE,
          EMONTHS LIKE VTBBEWE-ATAGE,
          EYEARS  LIKE VTBBEWE-ATAGE.
    PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
                TODATE   LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
    call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
      exporting
        i_date_from          = FROMDATE
        i_date_to            = TODATE
      I_FLG_SEPARATE       = ' '
      IMPORTING
        E_DAYS               = EDAYS
        E_MONTHS             = EMONTHS
        E_YEARS              = EYEARS.
    WRITE:/ 'Difference in Days   ', EDAYS.
    WRITE:/ 'Difference in Months ', EMONTHS.
    WRITE:/ 'Difference in Years  ', EYEARS.
    INITIALIZATION.
    FROMDATE = SY-DATUM - 60.

  • Can you text between two iPod touch iPods and is it free?

    Can you text between two iPod touches and is it free?  Is it free to text from Canada to US?

    Yes and yes. Both iPodsneed to have iOS 5 installed.

  • How to get a text between two XML tags?

    Hello everybody!
    I've got a problem! How can I extract a text that is between tags, like <myTag> My text </myTag> I have no problem to get the attributes inside the tags, however, i don't know how to get some text that is between tags. Here is my xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <tangram_request service_id="3">
    <send keep_session="nada">
    <source></source>
    <destination>3196931566</destination>
    <channel_id>2</channel_id>
    <text>Teste ServerSocket!!!</text>
    </send>
    </tangram_request>
    Now, there's a fragment of my code, which gets some tags' attributes:
    DOMParser parser = new DOMParser();
    InputSource resp = new InputSource(new StringReader(XML));
    parser.parse(resp);
    Document doc = parser.getDocument();
    Node node =(doc.getElementsByTagName "tangram_request")).item(0);
    if (node instanceof Element)
    Element el = (Element) node;
    service_id = el.getAttribute("service_id");
    System.out.println("\n\nService_id="+service_id);
    }else{System.out.println("Erro");}
    node = (doc.getElementsByTagName("send")).item(0);
    if (node instanceof Element)
    Element el = (Element) node;
    keep_session = el.getAttribute("keep_session");
    System.out.println("keep_session="+keep_session);
    }else{System.out.println("Erro");}
    Now, I want to get the texte between <destination> ... </destination>
    How could I do that?
    Thanks a lot
    Calegari

    Thanks... It worked fine!!!
    Now how can I get lots of <desctination>... I did something that haven't worked...
    node = (doc.getElementsByTagName("destination")).item(0);
    while(node.hasChildNodes())
    destination = node.removeChild(node.getFirstChild()).getNodeValue();
    System.out.println("destination="+destination);
    And now, my XML is like:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <tangram_request service_id="3">
    <send keep_session="nada">
    <source></source>
    <destination>3196931566</destination>
    <destination>3196931567</destination>
    <channel_id>2</channel_id>
    <text>Teste ServerSocket!!!</text>
    </send>
    </tangram_request>
    Thanks so much!
    Calegari

  • Sql Query for getting data between two dates

    Dear Sir,
    I have one problem, i have date stored in varchar datatype of (X) table in mysql as it was not supporting the date format of (dd/mm/yyyy) so know the problem is,
    When i going to get the data between the the two dates it is giving the un reliable answers such that
    when i am asking the query as data between 1st April to 31st December 2009 it is showing the data from the 2008 .
    is there any way to solve this problem,please help this is an urgent requirement, your replay will be helpful to me.
    With Regards
    Ramakrishna Y

    You either have a SQL problem and this is the incorrect place to ask.
    Or you have a Java problem in code we cannot see. When posting code use the code tags. Click the CODE button and paste your code between the tags that appear.

  • Is there a way to delete text between two strings?

    In Pages, is there a way to delete all text containted between two strings?
    For example, if I have a text document that looks like this:
    String 1
    String 2
    Unwanted text
    Unwanted text
    String 3
    String 4
    Is there was to delete the unwanted text between string 2 and 3 so it looks like this:
    String 1
    String 2
    String 3
    String 4
    The unwanted text is differnet between documents but string 2 and 3 are constant. I want to do this via automator for the same strings on multiple documents.
    Any help is appreciated!

    Do you mean Pages '09 v4.3?
    There were some links here:
    https://discussions.apple.com/message/24051199#24051199
    Peter

  • Google maps "get directions" between two points stopped working in firefox

    When using google maps to find directions between two points "Get Directions" it will just sit there loading... never finishing and showing the routes between the locations.
    This used to work fine about a month ago. I have not done anything, expect update Firefox.

    I can still get the basic directions to work in Google Maps, but recently the 3D driving directions has stopped working, and I'm pretty sure it stopped just about one Firefox update back. I realize this function is gravy to many people - a toy - but for someone who uses visual cues it has been extremely useful for imprinting the information in my mind, familiarizing myself with the route ahead of the drive. When I am traveling without a 'navigator' - a passenger who can read the directions as I drive - this is a huge help. Today I got a message about updating the GoogleEarth plugin, which I did - twice! Still no 3d directions, though suddenly the GG 3d driving simulator works. This has to be a FF problem :-(

Maybe you are looking for

  • Problem in Import PO

    Hi, there is one import po for vendor in europe in currnecy euro for two items. po is completed in following manner: 1) invoice for customs duty payment 2) migo with excise invoice capture 3) excise invoice posting 4) miro fpr vendor now, values in s

  • Add a Button in a table header Webdynpro

    Hi all, how can'i add a button in a table header ? and how/where schould be implemented? thank you all

  • What are the ways to control CPU usage?

    Database: Generic OS : Linux Problem Description : Q: What are the ways to control CPU usage precisely like instance caging for 11g if the database host has multiple 10g instances? What are the ways to control CPU usage precisely in database host tha

  • Error message on Nook

    Receiving an error message when I try to copy library book from my adobe reader to my Nook.  It says I do not have permission to copy.  I have not had any previous problems copying library books to my Nook.

  • Is it safe to disable outgoing mail from one of my accounts?I

    I have two e-mail accounts, but want to eventually stop using one of the accounts and use my gmail account full time. Sometimes when I send e-mail it will use my old e-mail address as the sending address. I want to cease using the old e-mail address