How to remove trailing carriage returns

I have this field that has chr(10) for each line at the end, however there are 2 CHR(10) at the end
I've tried replace but that didn't work also reading you can't use regexpr_replace with a negative value.
e.g.
This is line1 chr(10)
This is line 2 chr(10)
chr(10)
chr(10)
Any ideas please
Database 10g Enterprise Edition Release 10.1.0.5.0

Hi,
frm40735 wrote:
I have this field that has chr(10) for each line at the end, however there are 2 CHR(10) at the endWhen there are 2 (or more) do you want to remove all of them?
If so:
RTRIM (str
      , CHR (10)
I've tried replace but that didn't work also reading you can't use regexpr_replace with a negative value.It's unclear what you mean.
In regular expressions, a pattern can be anchored to the end of the string, like this
REGEXP_REPLACE ( str
            , CHR (10) || '$'
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
Explain, using specific examples, how you get those results from that data.
See the forum FAQ {message:id=9360002}

Similar Messages

  • Removing the carriage return / Tab during data extraction

    Hi ,
      I have an issue with removing the carriage return / Tab from the extracted (Flat File) data from SAP EKPO table.
      1) While uploading(Long Back) the Legacy data to SAP tables the carriage returns and Tabs in Product description were uploaded to SAP tables.
      2) Now I am extracting data from bkpf,..EKPO.. tables  to a flat file . 
    3) When I extract the data i. PO number, Product description,......
    The Product description is going to 3 to 5 lines depending on the carriage returns and Tabs in the Product description.  Ekpo-txz01
    Ex : Mfg # DS104NA / NET######GEAR DS104 Hub######model
        I want  this product description in one continuous line. It is possible only  by removing the Carriage returns and tabs from product description before concatenating and TRANSFERING the file to Server.
    4) What is  getting:  The line is breaking @gear @ Hub due to Carriage return/Tab
    Mfg  D  NET
    GEAR DS104 Hub
    model   .
    5) What is required is: in one line
    Mfg  D  NETGEAR DS104 model
    In the process I am extracting product description from Ekpo-txz01 . So it is internal table. Now I want to remove the carriage return / Tab .
    How these can be removed.
    Thanks,
    Vasu

    Dear Vasu,
    Sometimes there is a problem that cannot be solved normally. This is one of them.
    The reason why the mentioned methods do not work is because you need to remove actually two characters CR and LF in one stroke. You can identify one but then not the other. So approach it from the other side.
    Simply define what your correct characters might be AND only use them to export.
    Below you will find a FORM routine that does just that (only passes defined valid characters and NOT others).
    FORM validate_field USING    VALUE(field_in)
                        CHANGING field_out.
    CONSTANTS:
    All low caps characters
      validlow(26)  TYPE c VALUE 'abcdefghijklmnopqrstuvwxyz',
    All upper caps characters and all figures
      validhigh(36) TYPE c VALUE '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ',
    All other characters (starting with space)
      validrest(32) TYPE c VALUE ' <,>.?/:;"{[}]|\~`!@#$%^&*()_-+=',
    Single quote
      validquote           VALUE ''''.
      DATA:
        pos(1) TYPE c,         " Container to hold 1 character
        l      TYPE i,         " Length
        i      TYPE i.         " Indexer
    Determine length
      l = STRLEN( field_in ).
    Stripping loop
      WHILE i LT l.
      Get one character 
        pos = field_in+i(1).
      Check its validity
        IF pos CO validlow
        OR pos CO validhigh
        OR pos CO validrest
        OR pos EQ validquote.
        When valid, use it
          concatenate field_out
                      pos
                 into field_out.
        ENDIF.
      ENDWHILE.
    ENDFORM.
    Hopes this helps solving your problem.
    Regards,
    Rob.

  • How to remove a hard return

    What is the command for removing a hard return? I want to know how to remove a hard return in a document or an email (I’ve tried both Word and my email). I'm new to Mac but on my PC I usually just put the cursor to the right of the last letter on the line and hit delete and the line below gets moved up but in the MAC when I do that all it does is delete the letters in the word to the left of the cursor.
    Thanks.

    After playing with this idea it looks like the solution is to put the cursor in front of the first word on the line you want to move to the line above it and then hit delete. Just hitting enter/return adds another hard return.
    Thanks!

  • How to add a carriage return

    Hi
    How to add a carriage return after Survey Type, so that the Channel Time will start from column one.
    Thanks,
    Steve
    Solved!
    Go to Solution.
    Attachments:
    Write.vi ‏39 KB

    try something like the following draft. (not tested, so modify as needed).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Write-MOD.vi ‏32 KB

  • How to remove trailing zeros from a fraction part.

    How to remove trailing zeros from fraction part, need standard API rather then some java code.

    user8726363 wrote:
    How to remove trailing zeros from fraction part, need standard API rather then some java code.I'm pretty sure we have all gathered that English is not your first language, but your question is not a good question in any language.
    Back up. Take a deep breath.
    Now - what's your problem ?
    Please illustrate with results, and the code (just the class/method; not your entire application) that is causing them.
    Winston

  • How to find a carriage return and Line feed?

    I need to detect if a crriage retunr and line feed present on each row in my text file before allowing user to upload the text file
    I know how to remove them from each line but what I need is to detect them no removing them from file.
    Our concern is when the a row does not have carriage return and line feed.
    Is there a way to find this using CF? Please help
    thanks

    That is exactly the problem Dave, if some rows do not have line feed, they're not being inserted into DB, it skips other steps and go right to finish. It looks
    like the file is done processing.
    So I need to do early rejection to this kind of file.
    I used cfloop to catch anything else that do not follow the formatting rules.
    Here is what I already done:
    Right after the file got uploaded, I have these codes:   
    <cfloop  index="x" file="#MyFile#" >
      <CFSETMyLine = Replace(x,chr(9),"|", "ALL")>
      I'm using a few functions, such as, Left(), Mid(), Right(), etc to make sure certain rules are followed.
      Up till here, it's done and tested, everything is working.
      The only problem is when 1 or more rows don't end up with line feed and or carriage return.
      I plan to add some codes to check the end of each row for chr(10) since it is looping for every row anyway.
      If detected, process file normally otherwise stop processing.
    </cfloop>
    So this can't be done in CF?

  • How to remove trailing zeros 20353675.0000000

    All numeric decimal columns all are showing trailing zeros, how to remove them while processing within the query transform.
    20353675.0000000
    Thanks a lot for the helpful info

    You can use the trunc function to remove the decimal places.
    Syntax: trunc( number, [ decimal_places ] )
              <number> is the number to truncate.
             <decimal_places> is the number of decimal places to truncate to. This value must be an integer. If this parameter is omitted, the trunc function will truncate the number to 0 decimal places.
    Eg:     trunc(125.815)  would return 125
              trunc(125.815,0)  would return 125
              trunc(125.815,1)  would return 125.8
             trunc(125.815,2)  would return 125.81
             trunc(125.815,-1)  would return 120

  • Interactive Report: how can I display carriage returns?

    Hello everybody.
    Here is my problem: I created a table containing a field COMMENT varchar2(4000) and using APEX 4.1 I built an interactive report on it.
    Users can fill the field COMMENT with sentences on different rows, ex:
    " this is the first line
    this is the second line
    this is the third line"
    This is correctly managed in the FORM, where I defined the field COMMENT as 'Text Area', but in the REPORT I wasn't able to set it in a way which permits to see it whit the carriage returns: the content is displayed on one row only : "this is the first linethis is the second linethis is the third line".
    I tried and set all the possible field types, but I found no ways to display the content exactly as it is (with carriage returns).
    Obviously I cannot use HTML
    , since I cannot ask users to digit it when inserting their text.
    Could someone suggest me how to reach this result? In need to use the interactive report because the searching/filtering tool is fundamental.
    Thanks in advance,
    Daniele

    >
    Please update your forum profile with a real handle instead of "user9211286".
    Here is my problem: I created a table containing a field COMMENT varchar2(4000) and using APEX 4.1 I built an interactive report on it.
    Users can fill the field COMMENT with sentences on different rows, ex:
    " this is the first line
    this is the second line
    this is the third line"
    This is correctly managed in the FORM, where I defined the field COMMENT as 'Text Area', but in the REPORT I wasn't able to set it in a way which permits to see it whit the carriage returns: the content is displayed on one row only : "this is the first linethis is the second linethis is the third line".
    I tried and set all the possible field types, but I found no ways to display the content exactly as it is (with carriage returns).
    Obviously I cannot use HTML
    , since I cannot ask users to digit it when inserting their text.
    Could someone suggest me how to reach this result? In need to use the interactive report because the searching/filtering tool is fundamental.Use a CSS style sheet with attribute selectors. Put this in the page HTML Header, replacing the <tt>T_EMP_NAME</tt> etc selectors with the actual <tt>id</tt> attributes of your column headers:
    <style type="text/css">
    .apexir_WORKSHEET_DATA td[headers="T_EMP_NAME"] {
      white-space: pre;
    </style>
    Interactive Report Control Break disregards HTML Header style.

  • How to put a carriage return in a String

    I am creating an error message on my class which is called and displayed on my JSP page.
    In my string I want it to do a Carriage return. I used a \n however it just ignores it when displayed in JSP using scriplets.
    Class declaration:
    -- Want this line to start on the next line..
    /** Used for the Error message for a text box. */
    private final String TEXTBOX_ERROR_MSG = "\n NOTE: The text box characters left count may not be accurate.";
    Used in getDBErrors() method:
    --errors is an array of error records displayed in the JSP
    if(this.notes != null && this.notes.length() > 4000)
         errors.add("Notes Tab: Notes section cannot be greater than 4000 characters." +  this.TEXTBOX_ERROR_MSG);
    JSP Page code:
    --Get the list of Errors from the class
    List pbrDBErrors = editBean.getDBErrors();     
    -- Display errors:
    for(int l=0; l<pbrDBErrors.size(); l++)
    %>
    <li>
        ----------- Display ERROR Message Here
        <%= (String)pbrDBErrors.get(l) %>
    </li>
    <%
    } %>++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    All the code works great - Its just the TEXTBOX_ERROR_MSG is displayed on the same line as the rest of the message and it scrolls off the page.
    How do it get it to do a cariage return?? \n does not seem to work.
    Thanks

    I learned something new today.. I guess I can go home :)
    I am creating an error message on my class which is
    called and displayed on my JSP page.
    In my string I want it to do a Carriage return. I
    used a \n however it just ignores it when displayed
    in JSP using scriplets.
    Class declaration:
    -- Want this line to start on the next line..
    /** Used for the Error message for a text box.
    private final String TEXTBOX_ERROR_MSG = "\n NOTE:
    The text box characters left count may not be
    accurate.";
    Used in getDBErrors() method:
    --errors is an array of error records displayed in
    the JSP
    if(this.notes != null && this.notes.length() >
    4000)
    errors.add("Notes Tab: Notes section cannot be
    ot be greater than 4000 characters." +
    this.TEXTBOX_ERROR_MSG);
    JSP Page code:
    --Get the list of Errors from the class
    List pbrDBErrors = editBean.getDBErrors();     
    -- Display errors:
    for(int l=0; l<pbrDBErrors.size(); l++)
    %>
    <li>
    ----------- Display ERROR Message Here
    <%= (String)pbrDBErrors.get(l) %>
    </li>
    <%
    } %>++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++
    All the code works great - Its just the
    TEXTBOX_ERROR_MSG is displayed on the same line as
    the rest of the message and it scrolls off the page.
    How do it get it to do a cariage return?? \n does not
    seem to work.
    ThanksThanks the <br> worked great....

  • How does one replace carriage returns (enter key) in text areas

    I have an address text area in one of my pages where end users are hitting enter after each part of the address. I want to replace the carriage return hex('0A') with spaces. How can I do that?

    If you're manually saving your data, you can just change your insert/update code as below:
    insert into myTable
    (myCol)
    values
    (replace(:PXX_MY_TEXT_AREA, Chr(10), ' '))
    where ...If you're building a page where you aren't directly saving your data, you can add an "on Submit/Before Computation" process that does something like:
    :PXX_MY_TEXT_AREA := replace(:PXX_MY_TEXT_AREA, Chr(10), ' ');

  • How to remove trailing delimiter generated by MFL output

    Hi,
    The last delimiter value of ^C is being generated for some odd reason as shown below:
    16428281^CFPL^C909709^CFPL^C^C946971^CSingle Phase(1)^C67039703702^CB^CConstructed^C17602 N 118 TR^C120/240^C08561^CN/A^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^CConstru
    cted^CAerial^C457225^CUnknown^C^CNo^CNormal Closed^CClamp^CB^C1^C2-Cover^C296688734^CNo^CNo^C50^C^CYes^CNo^CYes^C22860Y/13200^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
    ^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C16428199^Coh_fuse_switch^C67039823007W^C4^CD15A2^CAG0484^C22.9^C66637544501^C8147503^CFalse^C4^CJupiter^C45^C0^Cdefault^CYes^C
    Would anyone know how to remove a trailing delimiter that is generated as part of an MFL output or update my MFL to not produce the delimiter value at all for the last value?
    Thanks,
    Yusuf

    Hi,
    I was able to resolve this issue with some java code that performed some encode/decode of base64 data (MFL data that was supplied to the java callout turns out to be an array of byte data).  After decoding the data I performed the following:
    - found the string length
    - identified if the string ended with the special charater, which in my case was '\x03'
    - concatenated the string with the system version of a new line value.
    Thanks,
    Yusuf

  • How to remove trailing zeros using EngineeringFormatInfo?

    HI,
    I found a measurement studio formatter for SI notation.  
    For details, see the NI document.
    Here, I want to know how to remove any trailing zeros. I could not find any information about this. 
    For example, 
    code : string result = string.Format(EngineeringFormatInfo.Default, {0:s5}, double value)
    if  value = 1.2345678E-3,  result is 1.23457E-3. It is ok. 
    if  value = 1.2E-3,  result is 1.20000E-3. But I want to get "1.23m". 
    In labview, I usually use "%#.5p" format string.

    diluculo wrote:
    HI,
    I found a measurement studio formatter for SI notation.  
    For details, see the NI document.
    Here, I want to know how to remove any trailing zeros. I could not find any information about this. 
    For example, 
    code : string result = string.Format(EngineeringFormatInfo.Default, {0:s5}, double value)
    if  value = 1.2345678E-3,  result is 1.23457E-3. It is ok. 
    if  value = 1.2E-3,  result is 1.20000E-3. But I want to get "1.23m". 
    In labview, I usually use "%#.5p" format string.
    I don't understand how you are getting 1.23457E-3 ?  And claiming that is okay.
    If you are using the format string that you claim you are using, then you should be getting 1.23457m.
    It sounds like you are using string result = string.Format(EngineeringFormatInfo.Default, {0:E5}, value)

  • How to insert a carriage return in a varchar field

    Post Author: gilles
    CA Forum: Data Integration
    Hello,
    How do you insert a carriage return in a varchar field in BODI ? I couldn't find a function like CHAR(13)...
    Thanks
    Gilles

    Post Author: gilles
    CA Forum: Data Integration
    Thanks a lot,
    I'll upgrade to 11.7 (currently 11.5.1)
    Gilles

  • How to include a carriage return in a TestStand string variable

    Is there anyway to add a carriage return to a TestStand string variable. I am sending commands to an instrument using the Rs232 serial bus and they need to be terminated with a carriage return ie "\r". I know you can creat a DLL and return the string variables to TestStand but is there a beter way ?

    Hi Paul,
    Sorry about that, just noticed I left off the "" in my last response.
    Try "\\r".  that should solve it.
    Regards
    Ray Farmer
    Message Edited by Ray Farmer on 09-15-2005 09:14 AM
    Regards
    Ray Farmer

  • How to remove trailing space at the end of a song.

    This is related to this thread: Shorten song length (remove trailing bars) in Garageband 10.0.1
    I have also done some Googling and have found some links related to selecting and exporting regions, which I have tried, but this is what I noticed.
    It does not work when I select certain instruments, eg Synthesizer - Soundscape - Subtle Shiftscape or Synthesizer - Lead - Screamlead. I believe that what is happening is that those sounds tend to have some additional length to it. No matter where I cut my region, the additional length still get added. I don't have that problem if I don't select those instruments.
    Anybody has any ideas?

    Are you using GB 10.0.2 as well?
    I am using both - GarageBand 10.0.2 and GarageBand '11.
    And if I deselect all regions, File - Add Region to loop library is of course greyed out. Is it possible to save multiple tracks as a loop?
    No.
    Yep, I've deselected all regions. Still no luck.
    My answer above was in answer to your "This time GB felt I only needed the first 4 measures of the song, even though I defined an entire Region over the length of the song and selected everything with Ctrl-A..."
    You should be able to export the complete song, if you deselect all regions, and select all of the song using the cycle region with "Export Cycle region only" enabled, or with "Export Cycle region only" disabled, nothing selected, and the end-of-song marker correctly set.
    However, this will not get rid of the trailing empty bars.
    Reimport the bounced song to a new Ringtone project and trim it and save it as a tone, or to a regular project and add it to the Loop Library.
    Find the AIFF file of the loop in the Loop library - it will be installed in your User Library in your Home folder
    ~/Library/Audio/Apple Loops/User Loops/SingleFiles/

Maybe you are looking for

  • Ipad bookmarks not syncing with icloud

    I cant get my bookmarks from safari to sync with my ipad 1 and iphone 4s. Both OS are up to date.

  • Availabili​ty and Fitting of backlit keyboard to Envy DV6 - 7331SA

    I've an Envy DV6-7331SA which works just fine. I'd quite like a backlit keyboard. Googling around it seems that backlit keyboards are available but  1. Is this just a simple replacement. I presume the keyboard comes with the backlight cable and there

  • Solaris 10 IPMP and NetApp NFS v4 ACL

    Okay here is my issue. I have one T5220 that has a failed NIC. IPMP is setup for active-standby and the NIC fails over on boot. I can reach the system through said interface and send traffic out the failed to NIC (ssh to another server and do a last

  • Bypass proxy settings ignored

    Hi folks, At work we connect to the web via web proxy (Squid by all accounts). If I set the proxy manually in my browser, everything works fine but I'd rather have that set at Network prefs level. However, when I add *.local, 169.254/16 at Network pr

  • Can't log in on my android

    Hi Community, I just wanted to login with the android app, but it keeps telling me that this user already exists. And yes, I made sure to hit "login" instead of "register". What can i do to login? Thx schmattekAndroid 5.1.1 on Nexus5  EDIT: Got it! I