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

Similar Messages

  • 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>"));

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

  • Entering special characters at the command line.

    I'm writing a simple program in java that automates certain processes in learning a foreign language.
    This includes holding a database of vocabulary within the context of a sentence and testing a student on words they have encountered.
    Nothing too tricky, except that I am having trouble with entering special characters at the command line. I'm not really surprised by this and was hoping that someone could help me.
    I'm using a mixture of Solaris 8 and Mac OS X 10.3 for running the software, so anyone with any input on either of these systems will be able to help.
    The characters I am trying to enter are the following:
    �,�,�,�,�,�,�,�,�,�,�,�.
    They are latin, and used in Spanish amongst other languages.
    I'm a little confused by the implementation of character sets. I can enter these characters in applications such as word or textedit or an email, but just not at an X window.
    From looking at the web it appears that these characters can be input using the
    Latin1 (ISO 8859-1) character set or the ISO 10646-1/Unicode extension.
    I'm just not sure what I actually have to do to get it to work.
    If anyone can offer any help I'd be really grateful.
    Ian Stanton

    It's a problem that could be encountered in different circumstances, in this circumstance it is with a program I am writing in java.
    I anticipate that these days not that many applications are delivered that require use of the command line, but since I am still learning Java it is necessary to explore this avenue.
    It's interesting actually since presumably developers writing code for the international market need to accomodate characters similar to those I am attempting to enter, and more that are less familiar to me such as far and middle eastern scripts, and of course many others.
    We (possibly) assume that since a character is printed on our keyboard it is a simple matter to read it in. But what if I was a Spanish student wanting to type a character into the command line and that character wasn't there? I believe that Spanish (and variants of that language) is the third most spoken language on the planet.
    These characters are often relatively easy to enter in office and internet applications amongst others but apparetly not so at the command line.
    Maybe this question is more suitably asked of the Unix community but I thought it a good idea to try Java since i was writing Java code and that many Java programmers could have encountered the same problem.

  • 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

  • Creating Text files with special characters

    I have a problem writing and then reading special characters in a text file. I am using FileWriter and FileReader and once I write (using FileWriter) in a file.txt many characters with ASCII code less than 31, I can not read them back using FileRead. I simply get a content which is different from the one originally written.
    Does anyone have an idea about this problem ?

    The code is OK, problems may have occured during copy/paste. But in the original code it is written c.
    Here is a copy of the output of those lines that i'm talking about:
    Here is the ASCII Code >> 125
    Here is the ASCII Code >> 126
    Here is the ASCII Code >> 127
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 63
    Here is the ASCII Code >> 160
    Here is the ASCII Code >> 161
    Here is the ASCII Code >> 162

  • 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 :-(

  • How to Calculate AGE by getting difference between two Date Fields

    HI Gems
    I need to calculate AGE from getting difference from two date fields. But when i am trying to wrte fromula as Current date - date1(some date field) then it is showing error.
    How can i get values.
    Thanks
    Manu

    You already asked this question:
    How to calculate AGE from two different date fields

Maybe you are looking for

  • Can multiple users edit a draft page

    I have a client that is considering using Contribute to update their web site, but they need the capablility for multiple authors to edit the content of a page and then submit it for review before it is published. Can this be done with Contribute by

  • Video Pixelation Issue - New HP Pavilion 15-P008TX Notebook - Windows 8.1

    Ahoy, I've seen topics regarding this issue - i.e. first day running a new HP Pavilion 15-P008TX, using Windows 8.1... However the video quality on videos being played from the DVD Drive, HDD, and streamed videos (e.g YouTube) are extremely low quali

  • Need help in how to print new line character in unix using java

    Hi All, I use the printstream class to print some line in a text using java. here is the code:    FileOutputStream out; // declare a file output object         PrintStream p; // declare a print stream object                 p.print("\t");            

  • Photo stream not working between my iphone 4 and my ipad 2. Was working great until I change my apple id.

    Since I change my apple id, my iphone and my ipad dn't share the pothos through the photos stream, if i take a photo now with my iphone it'll go to my ipad, but no the old ones that are located in the same place, and if i take a photo with my ipad th

  • UEFI Vbios Request: MSI 290x Lightning

    I am having the 0% fan problem and I read that I require a vbios update. Bios File: drive.google.com /file/d/0BxcYJ_vRgohQU28zUnNBcTYwZVk/edit?usp=sharing Serial Number: 602-V307-04SB1402054110 Sorry for the link, it kept saying that I was not allowe