Regexp_replace to remove blank lines from multi lines in a single field

Gents. 10g R2.
   with test_tab as
   (select 'x'||chr(10)||'y'||chr(10)||chr(10)||'z' tester from dual)
   select tester from test_tabproduces
x
y
zI require
x
y
zThere's a lot of examples on how to end up with xzy, but I need to maintain the carriage returns, just strip out blank lines.
I've been trying with posix [:cntrl:] but it doesn't seem to want to work. Question: how to get the desired output?
If this has been answered on another post, please point me in the right direction and accept my apologies!

Hi,
The simplest thing might be to use LTRIM. (or TRIM, if you need to remove them from the end of the string, as well).
If you want a regular expression:
SELECT     REGEXP_REPLACE ( tester
                 , '(^|' || CHR (10) || ')' || CHR (10) || '+'
                 , '\1'
FROM     test_tab
;This might be easier to understand if you let x stand for CHR (10):
SELECT     REGEXP_REPLACE ( tester
                 , '(^|x)x+'
                 , '\1'
FROM     test_tab
;This is easier to understand: \1 is either the beginning of the string or x. When this is followed imeediately by 1 or more extra x's, then replace that whole pattern with \1 (that is, remove the extra x's).

Similar Messages

  • [JS] [CS2] Change all from multi line to single line composer

    Hi
    Does anyone know how to change all paragraphs, on all pages, in all textframes, from multi line composer to single line composer...
    Thanx
    Tim

    This should work:
    app.documents[0].stories.everyItem().composer = "Adobe Single-line Composer"
    Dave

  • WebDynpro Java: how to remove blank element from Table and Dropdown.

    Hi  Folks
    In a webdynpro application,
    I created a table and witten the below code to populate the table
         IPrivateDummyView.IFirst_TableElement First_Table_Element = null;
         First_Table_Element = wdContext.nodeFirst_Table().createFirst_TableElement();
         First_Table_Element.setF_Value("One");
         wdContext.nodeFirst_Table().addElement(First_Table_Element);
         First_Table_Element = wdContext.nodeFirst_Table().createFirst_TableElement();
         First_Table_Element.setF_Value("2");
         wdContext.nodeFirst_Table().addElement(First_Table_Element);
    As per the code, i got 2 row in the table.
    But , i have one Empty row on top of the table ,  how to get ride of this.
    i find the same problem happening with dropdown too, where i used DDBI, i populated a the content as mention, but i initial 2 row as blank and then i have my own elements ,as per my code.

    >
    > how to remove blank element from Table and Dropdown
    >
    Change selection property of related node to from 0..1 to 1..1 (mandatory)
    Re: DropdownByIndex and empty line (Thread: DropdownByIndex and empty line )
    Re: Can the empty selection be removed from element dropdownbykey(Thread: Can the empty selection be removed from element dropdownbykey )
    Edited by: Anagha Jawalekar on Nov 18, 2008 10:28 PM

  • Remove Blank Values from Slicer in Power View

    Hi all,
    I am trying to create a power view report from a power pivot data model. After creating the model when I try to use the slicer in power view I am seeing the Blank record. Then I checked that dimension in model where I don't have any blank value in there.
    Also I checked in fact table where it has a relationship with that dimension and I don't see any blank value there as well.
    I am currently blocked with this issue. Experts please jump in and give some ideas how to remove blank value from there.
    Thanks

    As MM-99 already stated correctly, the BLANK-member is created if there is one or more non-matching row in your fact-table that does not exist in the dimension-table
    maybe you have some issues with upper and lower case?
    or maybe there are some whitespace characters contained in the text?
    to identify the issues you may want to create a calcuated column in your fact-table as =RELATED('DimTable'[MyKeyColumn])
    then you can filter on that column and see if any blank values appear
    hth,
    gerhard
    Gerhard Brueckl
    blogging @ http://blog.gbrueckl.at
    working @ http://www.pmOne.com

  • HOW can i rotate the loop as many lines of multi line container in BPM

    Hi All
    I have to send an idoc to 2 Receivers by spliting the message.
    Based on the occurance of a particular source segments i need to create those many instance of targets.
    IDOC ---> Rec1 (More than one message instance)
         ---> Rec2  (More than one message instance)
    I have taken messages of Receiver into a multi line container1
    and messages of Receiver 2 into another multi line container2.
    HOW can i rotate the loop as many lines of multi line container.
    Thans
    Prasad

    Hi Raj
    There are two webservices are 2 receivers.
    In the idoc there is specific segment , which occurs unbounded,Each occurence we Need to check the value of a particual field and send to corresponding Receiver.
    For Ex:
    ZE1KONH (1..Unbounded)
       >MSFGN =004 --> Rec1
      >> MSFGN==0009 Rec2
    It could be like , 1 or more segm for Rec1 and 1 or more segm for Rec2
                            all are for Rec1 or All are for Rec2.
    so in the tranformation we need to put all message of Rec1 in corresponding multiline container as well for Rec2. Then i need to send to correspongind Receiver.
    So here i need to send all splited messages to appropriate receivers

  • How to remove blank data from a byte array

    Hi All,
    How to remove blank data from a byte array. Suppose I created a byte array as byte[] b = new byte[8192] and i read the data as inputstream.read(b). If the data that has been received is only 1000 bytes length, how to find out how much data has been read or how to delete that blank 7192 bytes of data?
    Thanking you,
    Regards,
    Shankar.

    1) Always try to sidestep this by allocating only the necessary amount of space required...
    2) If 1 is not possible, you will have to index byte for byte how much data was read into the array which
    denotes reading byte for byte... not ideal as this is relatively slow...
    Are you reading from a file?

  • Navigation from multi line block

    I am using multi line item at key_next_item trigger cursor is moving to next line
    that is ok but with some fuctional key mapping or some other trigger I want to move cursor to next block.
    How to do it?

    Hi,
    use a key trigger and call go_block() built_in
    Frank

  • Remove vertical scrollbar from multi-row af:inputText

    Hi,
    Is it possible?
    I'm using JDeveloper 11.1.2.1
    I have two text field (af:inputText) and field 2 is a multi line row, which automatically adds extra width for the vertical scrollbar, and throws off the right alignment
    field 1 |________|
    field 2 |_______|v|
    I need both field 1 and 2 to be left and right aligned
    i.e.
    field 1 |_______|
    field 2 |_______|
    Is there a way to do this? I was thinking this could be achieved by removing the vertical scrollbar, but I'm not sure how to do this.
    Also, the application needs to be viewed in both mobile device (iPad) and desktop. Since iPad doesn't use scrollbar (hence it's not rendered), setting both fields to have fixed width won't achieve what i need, because it will be correct in one version, but not both.
    Thank you for any information.
    Regards,
    Andi

    Hi Navaneeth,
    Code:
    <h:panelGrid columns="2" id="pg1">
    <af:outputLabel value="Field 1" id="ol5"/>
    <af:inputText value="#{bindings.ModelCode1.inputValue}"
    required="#{bindings.ModelCode1.hints.mandatory}" columns="#{bindings.ModelCode1.hints.displayWidth}"
    maximumLength="#{bindings.ModelCode1.hints.precision}"
    shortDesc="#{bindings.ModelCode1.hints.tooltip}" id="it4">
    <f:validator binding="#{bindings.ModelCode1.validator}"/>
    </af:inputText>
    <af:outputLabel value="Field 2" id="ol4" shortDesc="#{bindings.Comments.hints.tooltip}"/>
    <af:inputText value="#{bindings.Comments.inputValue}"
    required="#{bindings.Comments.hints.mandatory}" columns="#{bindings.Comments.hints.displayWidth}"
    maximumLength="#{bindings.Comments.hints.precision}" shortDesc="#{bindings.Comments.hints.tooltip}"
    id="it9" rows="#{bindings.Comments.hints.displayHeight}">
    <f:validator binding="#{bindings.Comments.validator}"/>
    </af:inputText>
    </h:panelGrid>
    Current layout:
    http://img607.imageshack.us/img607/4282/fieldalignmentproblem.jpg
    Desired layout (To have it aligned as per the green line):
    http://img338.imageshack.us/img338/7865/fieldalignmentdesired.jpg
    Thanks,
    Andi

  • Remove dead account from on-line billing

    Is it possible to remove an old Broadband Talk Account from my on-line BT, it always appears first and has been dead for a few years now and basically just annoys me when logging in to view my live account details.
    Thanks

    You'll need to contact BT as messages on this customer forum don't automatically go to them. Best place to start is Live Chat.
    You can click the white star next to this message if you think it was helpful.

  • How do I remove one person from a line of people then "close" the line to make it look like that person was never there?

    Especially with a complicated background.

    A lot of what is demonstrated in the CC tutorials would be relevant in CS5. Give it try and see if you get stuck.  It is a big ask expecting anyone here to give you step by step instructions, and it is all there in those tutorials anyway.
    I figured it out.  I wasn't looking for step by step -- I just couldn't get my head around the general procedure. 
    Bob

  • Remove Blank Space from Crystal report

    Hello,
    i am new in crystal report work.
    recently, i have created one crystal report which display item and remaining other detail like tax detail,item grand total, Some extra remark,etc.
    But my scenario is that if i take three or more item then it take two page that's ok. on that case i have no problem,
    but if i  take only single item it will take two pages.
    how can i remove unnecessary area.
    i attached below image for better understanding.
    i also provide crystal report if required.
    if there is image not visible then i also attach below.
    Plz... Help me ASAP.
    Thanks,

    It seems like your tax detail section is another sub report please compact the subreport if attached.
    Right click on the object and select Format Object > checkbox "Supress Embedded Field Blank Lines"
    Right Click on the section and click "Fit Section"

  • How to remove blank pages from report

    Hi All
    i have a condition where i have to display the record only when trxn lines are available for that record ,inside my for each group condition i put the if condition having a count variable so if count is not zero then only the record will be displayed ,it works but problem is it shows blank pages for those records.
    any clue would be very helpful.Thanks in advance
    Thanks
    Pratap

    Hi All
    The solution of this issue is given in below mentioned thread
    How to avoid blank page in BI Publisher
    Thanks a lot to Vestrini :)
    Thanks
    Pratap

  • Using REGEXP_REPLACE to remove XML data from between XML tags

    Hello there,
    I am trying to use the REGEXP_REPLACE SQL function on a piece of XML, to remove the actual XML data from the elements. My end goal is to end up with a comma-delimited list of XML element names. As part of the first step, I just want to rip out all the actual data.
    I tested the following query, and it initially appeared to work:
    SELECT REGEXP_REPLACE('&gt;THIS IS A TEST&lt;',
                          '&gt;([[:alnum:]]\s|\S)*&lt;',
                          '&gt;&lt;' ) AS test_result
      FROM dual;Unfortunately, when I applied this to a full XML string, it didn't work. Here is the test query I used:
    SELECT REGEXP_REPLACE('&lt;ROW&gt;&lt;TEST_ELEMENT1&gt;123&lt;/TEST_ELEMENT1&gt;&lt;TEST_ELEMENT2&gt;THIS IS A TEST!&lt;/TEST_ELEMENT2&gt;&lt;/ROW&gt;',
                          '&gt;([[:alnum:]]\s|\S)*&lt;',
                          '&gt;&lt;') AS test_result
      FROM dual;I ended up with the following output:
    *&lt;ROW&gt;&lt;/ROW&gt;*
    What I was trying for was:
    *&lt;ROW&gt;&lt;TEST_ELEMENT1&gt;&lt;/TEST_ELEMENT1&gt;&lt;TEST_ELEMENT2&gt;&lt;/TEST_ELEMENT2&gt;&lt;/ROW&gt;*
    If you're reading this and you're a Posix RegExp Guru, please could you let me know exactly where I'm going wrong? RegExps are not my strong point, but I'd like to get better at them.

    jmcnaug2 wrote:
    Just out of interest, how would you go about writing the XQuery function so that it returns the actual XML Element values in comma-delimited form (This is Oracle Canonical XML, so has a very basic layout)? ;)Do you mean like this ?
    SQL> SELECT xmlquery(
      2    'for $i in $d/ROWSET/ROW
      3     return string-join($i/*, ",")'
      4    passing dbms_xmlgen.getXMLType('SELECT employee_id, last_name, first_name FROM employees WHERE rownum < 10') as "d"
      5    returning content
      6  ).getClobVal() as csv
      7  FROM dual;
    CSV
    100,King,Steven
    101,Kochhar,Neena
    102,De Haan,Lex
    103,Hunold,Alexander
    104,Ernst,Bruce
    105,Austin,David
    106,Pataballa,Valli
    107,Lorentz,Diana
    108,Greenberg,Nancy
    SQL>

  • How to remove blank pages from WebI Report in view page layout option

    Hi,
             I am working in Business Objects XIR2 environment. I have a WebI report with several sections. I need to show the report as a book with 69 sections (each section on new page). there are 69 sections on cost center and each cost center section has almost 10 sections embedded in it. When i see in regular view - I only see 69 pages but when I try to see in "View Page Lay out" option, there is one blank page added after each results page.
    Please let me know how to remove this blank page. I need to give users the option to download the book as PDF on to their machine. Now, when I download to my machine, I see one blank page after each results page.
    Thanks in advance.

    Jus convert your report in Page Layout mode and see if your first pafe is getting expand in the second page.
    Now check if there are any cell going into second page.
    - if there are any blank cell which is there after table.
    you have to check formating very carefull.

  • Remove blank page from document in Pages

    HI there
    I have created a document only require 1 page however it has created 2 pages. The second page is blank and I wish to delete it.
    Thanks

    It really helps if you tell us what version of Pages and what you have created and how.
    Generally however you probably just have something on that "blank" page and need to delete it:
    Menu > View > Show Invisibles
    Peter

Maybe you are looking for

  • Binding AD to OD but only for certain users.

    We have a small (winXP) computerlab in an educational facility. In order to ensure that the computers are locked down they are all part of a Domain managed by a Win2003 AD server. I have done quite a few Registry Hacks to the Hive to make sure the us

  • Edit image cannot save

    Posted similar topic also in InDesign forum because it involves both... Hi, have a strange problem for few days. If I edit image (PSD) in InDesign with "Edit original" command in Photoshop sometimes after editing image I get message "Could not save "

  • Can I use iMessage/FaceTime without a serial number on my Mac?

    I have a iMac that hade work done on it years ago. It no longer has a serial # in theabout this mac window. I just upgraded to Mountain Lion in part to use iMessage and especially FaceTime. I cannot get either program to work. I read online that thes

  • Unity Service - Error: Unable to communicate with service control center

    Hi Guys, I have a CUC Cluster of 2 nodes at 9.1.2  I did a Cobra restore and since the cobra I have an issue when I go to Unity Connection Servicability and then If I go in service Management I have this error :  " Error: Unable to communicate with s

  • PSE 9 Organizer Folders for New Computer Old Catalog

    I have my image files and catalog on an external SSD that is always mapped to the same drive letter on my laptop. I recently bought a new laptop and installed PSE 9 on it. When I open my catalog on the SSD that is mapped to the same drive letter all