Newlines and CRLF

I'm trying to replace newlines (and other characters) in a string of text (which is actually a SQL statement, stored in the table as varchar2), but what I'm seeing is that when this is performed in pl/sql, newlines are already replaced by something else. Namely (as it appears to me), a hyphen. Double new-lines will show up as double-hyphens and so on. But I can't perform a translate or replace on this 'special' character -- it just fails.
To clarify, I can call a SELECT on this data in, say, SQLPlus, and it shows the carriage returns. However, when using (for example) a FOR CURSOR, and calling a debug statement which prints out the same data, each newline is replaced with a hyphen.
I've ruled out that it is merely my print statement (this prints to a log file), because other functions I use later depend on expecting, for example, ' FROM ' (note the spaces), but it comes across as '--FROM' or 'FROM--', and fails the INSTR.
Hope this is clear enough.

In a similar (perhaps irrelevant?) vein, a standard for the charset encoding should be defined at the project level; usually, it's UTF-8. As today, it seems that ISO-8859-1 is (the facto?) used in
./org.eclipse.graphiti/src/org/eclipse/graphiti/services/IPeCreateService.java
./org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/TransparentGhostFigure.java
(search for 'zier' , at Bézier curve). It's only in comments, but, again, this kind of thing can make trouble for GIT comparisons.

Similar Messages

  • JTextPane and CRLF

    Hi, I have a simple editor that can save and read files, I use a JTextPane for the text entry. In brief, my question is: How to get a JTextPane to display CRLF as one character?
    I've noticed that when I type into the text pane and hit enter/return it inserts one character, so for example if I type:
    test string and return
    and right after I hit return I left arrow twice my cursor is between 'r' and 'n'. But when I save that file to Windows, the return is saved as a CRLF, 2 characters. If I open the file, read it into the document model and display it, there is a 2 character CRLF, so in the above example I would have to use the left arrow 3 times to get between 'r' and 'n'. I don't want to fool with the document itself, can someone tell me how to get the JTextPane to display CRLF as one character?
    Thanks!

    I've never seen a JTextPane behave as described, but there can be a difference between
    1) the number of characters displayed in a JTextPane
    2) the number of characters written to a file
    See this thread for an explanation:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=397160

  • IE ignoring newlines and spaces

    Hi All,
    I wrote a servlet to upload a file. While viewing the attachment in the IE browser, it's ignoring the newlines in the file. The same attachment when viewed in Firefox and Opera browsers, it's rendering the file contents properly. From this I conclude that this is not the problem with the code. I feel IE is ignoring the newlines present in the attached file. Could you please suggest me a way to get rid of this problem? Is there any way to instruct IE not to ignore newlines? The code responsible for printing the output is,
    response.setContentType(attachment.getAttachMimeType());
    response.setContentLength(attachment.getAttachObject().length);
    response.setHeader("Content-Disposition" , "attachment; filename=" + attachment.getAttachFileName());
    byte[] buff = attachment.getAttachObject();
    ServletOutputStream out = response.getOutputStream();      
    out.write(buff);
    out.close();
    This is very urgent. Your help is highly appreciated.
    Thanks,
    Tarun .

    My application has the requirement to upload any type of file and view that attached file. What baffles me here is, though the content-type is "application/octet-stream" IE is not prompting me a dialog box asking me to the choose the application through which I've to open the attached file. I've set the header i.e "Content-Disposition: attachment; filename=" and let's assume that the filename is "boot.properties", so IE should prompt me a dialog box, instead it's trying to display the file contents in the browser. When I attach a word document, IE is trying to display the file contents in the browser, but it's reading the MIME type as "application/msword". For files whose MIME type is "application/msword", IE should open them in MS-Word. Why my IE is behaving strange? It's trying to display the contents of the file in the browser irrespective of the MIME type. How can I get rid of this problem?

  • Use of newlines and breaks

    I was just experimenting with PHP dates and found most of the following code on the php site:
    <?php
    echo strtotime ("+1 day"),"\n";
    echo strtotime ("+1 week"), "\n";
    echo strtotime ("+1 week 2 days 4 hours 2 seconds"), "\n";
    echo strtotime ("next Thursday"), "\n";
    echo strtotime ("+ 3 months"), "\n";
    echo("<br>");
    echo("that was a break <br>");
    echo((isset($_SERVER["REQUEST_TIME"]))?$_SERVER["REQUEST_TIME"]:"")
    ?>
    <br>
    <?php
    $date = new DateTime('2000-01-20');
    $date->sub(new DateInterval('P10D'));
    echo $date->format('Y-m-d') . "\n";
    ?>
    <br>
    <?php
    $date = new DateTime('2000-01-20');
    $date->add(new DateInterval('P6M'));
    echo $date->format('Y-m-d') . "\n";
    ?>
    <br>
    <?php
    $date = new DateTime();
    echo $date->format('Y-m-d') . "\n";
    echo "no newline shown";
    ?>
    None of the <br> or "<br>" code ws originally included.
    The output from this is:
    1332149953 1332664753 1332851955 1332374400 1340008753
    that was a break
    1332063553
    2000-01-10
    2000-07-20
    2012-03-18 no newline shown
    The "\n" code seems to do nothing.
    If I replace it with "<br>" I get what I expected.
    So what is the purpose of "\n" and when (if ever) can or should it be used.?

    A newline character is consider whitespace and HTML treats whitespace as a single space character. You might want to use the newline character if you are creating a file or email.

  • Stretch with Overflow and CRLF's

    I'm having a problem with the Stretch With Overflow,
    specifically in relation to data that contains CRLF characters. It
    seems to me that the rendering engine doesn't recognize the fact
    that when it sees a CRLF, it should add on 1 line worth of space.
    For example, if a query column has a few words in the first line,
    two CRLF's then a few words in the third line, I only see the first
    line.
    I have a horrible workaround in place right now that goes
    like this for the field expression:
    Replace(query.columnName, chr(13), RepeatString(chr(5),100)
    & chr(13),"All")
    This works OK but produces inconsistent results, generating
    more space than required for most instances, and not enough for
    some.
    Is there some better workaround that anyone's come up with?
    Is this a known issue?
    TIA,
    Joe

    My guess is that your problem is that your data only has a
    carriage return character in it and no line feed. The report
    builder doesn't seem to handle carriage returns too well, so if you
    do Replace(query.columnName, chr(13), chr(10), "ALL") it might
    solve your problem.

  • TRANSFER statment and CRLF

    Hello!
    I'm using the following line in my program to write a row from an itab to a file:
    OPEN DATASET gv_outbfile FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE MESSAGE lv_errmsg.
    When I download the file to my PC I notice that there's only a LF (0A) character at the end of the line.  My functional guy wants a CR/LF pair at the end of each row so it will display properly in Notepad.  How can I get the CRLF on the end of each row?

    Hi,
    CONCATENATE
          'Username'
          'Password'
          'First Name'
          'Last Name'
          'Group Code'
          'Location'
          'Email'
          'PersonnelNumber'
          'DepartmentName'
          'EVP'
          'EVP-1'
          'Function'
        cl_abap_char_utilities=>CR_LF
        INTO lv_str
    This statement will give you a carriage return at the end of line.
    There are more attributes in the class CL_ABAP_CHAR_UTILITIES like Line feed, Tab etc etc.
    Amandeep

  • Removing Newlines are Carriage returns from query

    Hi i have this query .
    SELECTdivcode as div_cd, divname as div_dsc,
    nvl(modcode,0) as mdl_cd, nvl(mod,'All') as mdl_dsc
    FROM Test
    The values in these columns sometimes have newline and CRLF in them. I need to chek all columns for Newline or CRLF and strip them off.
    Can anybody plase guide me how to do that

    user13078372 wrote:
    It Does not solve my problem .
    like if i want to remove a newline character like '\n'
    Bascially i want to remove all newline(\n) and CR/LF characters , can anybody please help regarding this
    I think using REGEXP-Functions is the right way, because regular expressions are powerful choice regarding string-manipulation/-checks... You have to find the right combination of the regexp-pattern-parameter!
    CR/LF will be removed by pattern [:cntrl:], but - yes - will not match "\n"
    try using following (example):
    select regexp_replace( 'this is my line\n and its end\n', '(\\n)$', '') from dual ;
    this is my line\n and its endabove pattern should remove "\n"-terminators only at the end of the line; if you omit the "$"-sign in the pattern, then "\n" will be removed everywhere:
    select regexp_replace( 'this is my line\n and its end\n', '(\\n)', '') from dual ;
    this is my line and its endTry combining both patterns (above and the [:cntrl:])...
    You should study regular expressions to get a deeper insight - it's powerful!
    Regards
    Nuerni

  • External table and newline character

    I have an external table which is just a csv file, records delimited by newline and fields terminated by ','. However, the last column has a newline character appended to it. Is there an option in the external table syntax which will trim this?

    Try setting 'REJECT ROWS WITH ALL NULL FIELDS'
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch12.htm#1011062

  • JTextArea and newLine

    I have a JTextArea that wraps the text so the text doesn't go out of bounds. But when the text is then outputed to a text document, there is no newline and the text runs across the whole document, no \n. Is there a method in the JTextArea that automactically implements a new line for when using getText() or do I have to hard code that?

    You would have to hard code it.... when the JTextField wraps a line there is no new line entered within the text string. It's purely cosmetic.

  • Tab and next line characters in text area

    Hi,
    I have an issue with the textarea. The page is inserting /t and /n in the text I type in and everytime I save.
    I defined a text area like following in my jsp:
                   <textarea class="textarea_value" name="explanation" rows="5" cols="100">
                   <bean:write name="tiptrackerEditForm" property="explanation"/>
                   </textarea>
    css:
         .textarea_value {
              font-weight: normal;
              font-size: 12px;
         text-align: left;
         wrap: soft;
    When I type in a word in textarea, it saves without any /t or /n. But when retreive the data and load it into the form again, the page shows with an inserted tab (the word is moved to the right after inserting a tab). Everytime I save, it inserts a tab and /n characters. I know for the fact that the database or the form is doing this. It's in the jsp.

    Put the whole <textarea> element in a single HTML line without newlines and spaces.
    Thus, so:<textarea class="textarea_value" name="explanation" rows="5" cols="100"><bean:write name="tiptrackerEditForm" property="explanation"/></textarea>

  • New line character and carriage return in XML, please help, thanks

    In XML, "&#10;" is only the new line character. I have tried that. If you put that in your XML, for example:
    <tag>line1&#10;line2&#10;line3</tag>
    You will get the output as follow:
    line1
    ____line2
    ________line3
    (where ___ represents space)
    The output that I want is actually like:
    line1
    line2
    line3
    So I would like to ask how I can do this.
    Thanks,
    Jackie

    while parsing your XML file you can directly suppress these newline and similar things in characters() method of SAX parser.
    you can opt to do nothing when you encounter them else if it is normal character then use it to print it.

  • External table, fixed columns and variable record length..

    Hi all,
    I'm trying to create an exernal table of a txt-file. Te records are delimited by newlines and the field lengths are fixed. But...
    When one or more of the last columns are missing the record is truncated.
    Here's the problem: the access parameter "missing field values are null" doesn't seem to work here.. And all incomplete lines are rejected!
    Any ideas??

    Well, seems like I was on a wild goose chase here.
    The original version of the file was not in UTF8 but in ANSI. But for some reason somebody thought it was necessary to convert the file to UTF8.
    So, although my question isn't answered yet, my problem has been solved.

  • Cmd-+ and cmd-x not working

    Hi,
    I can't get ANY commands working that consist of a + or - sign.
    I have tried to reassign cmd-+ and cmd-- to zoom in and out but the commands doesn't work in the editor.
    When going into the command preferences I can clearly see that cmd-+ and cmd-- gets correctly detected when pressing them.
    Any advice would be kindly appreciated.
    /K

    You are puzzled by an operating system problem.
    I guess that you will get more accurate answers in the forum dedicated to this one.
    https://discussions.apple.com/community/mac_os/mac_os_x_v10.6_snow_leopard
    As far as I remember, the shortcut to insert a newline in a table's cell isn't
    alt + down_arrow but alt + return
    Oops, I read too fast and confound newline and new line.
    I applied the combo updater 10.6.8 and every shortcuts behave flawlessly.
    Yvan KOENIG (VALLAURIS, France) lundi 11 juillet 2011 15:50:12
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • Sql Loader fails with newline fields

    Hi,I have a csv file delimited by "|" which is exported from MS Access. One of the fields contains a newline (e.g. notes column) which sql loader treats as beginning of new record. Can anyone tell me how to force the loader to ignore this newline.Is there a way I can tell the loader to read the optional '"' and continue with the record till it finds a closing '"'? Or is there a way to export data from access an force it to skip newlines and make a flat file with one record per line? I hate fixed length columns since it adds up pain in wrting the control files. Also the loader still fails to read the record if it encounters a newline as discussed above.
    Thanks

    Unfortunately there is no command that can make sql*loader treat two lines in a text file as one record. Some one asked tom kyte same question, see what he had to say about it:
    http://asktom.oracle.com/pls/ask/f?p=4950%3A8%3A%3A%3A%3A%3AF4950_P8_DISPLAYID%3A4972732303253
    Why don't you create a staging table where you first load the data, and then from the data inserted into this table populate your original table in the form required.
    Anwar

  • NewLine Character in the String received from Interactive Adobe Form

    Hello Experts,
    Following is the issue we have with interactive Adobe Form
    We have a text area within the form. User enters the text in multiple lines in this text area.
    We are calling a backend function module designed in SE37 that accepts and process the data from the adobe form.  We are also processing the string data user enters in the text area.
    When we receive the string from the form, the newline character within the string is displayed as '#' in the debugger. We tried splitting this string using cl_abap_char_utilities=>newline and cl_abap_char_utilities=>cr_lf  but NO luck. Though in the debugger we see cl_abap_char_utilities=>newline  as '#'  in the debugger and also '#' is present within the string, for some reason when string is processed to find cl_abap_char_utilities=>newline, we can find/locate it.
    Because ABAP code is not able to identify the newline character within the string received from Adobe form, we are not able to maintain the formatting of the string as it was entered in the form.
    Any help to resolve this issue is appreciated.
    Thanks in Advance.
    Regards,
    Bhushan

    Hi Bhushan,
    I was going through your issue, and I feel this is something you can do with scripting. Basically you should read whole string and find the new line character and replace with a space or comma, as per your requirment.
    Do like following:
    In the exit event of the field select java script and write following code:
    var strng = this.rawValue;
    strng.replace(/\n/g, " ");
    above im reaplcing new line with a space.
    I think it should work I have not tested it. Pls update if you test it .
    Regards,
    Ravi.D

Maybe you are looking for

  • Calendar app skipping events

    Once I set up an Event in Calendar, the default is that a notification appears on my desktop and on the screens of my iPhone and iPad.  In any event, that's how it works on my devices. Because many of my Events are to remind me of tasks/chores which

  • FM to logoff user sessions TH_DELETE_USER

    Hi, We have a requirement to develop a report program which should log off all the sessions of a specific user. We tried to use the standard FM 'TH_DELETE_USER' for this functionality but we are getting 'AUTHORITY_ERROR' when we execute this FM. If a

  • HT1430 help my phone just shut off cant get it to come back on

    how do I get my phone to come back on

  • Sudden Certificate Error

    I've used version 4.0.1 of the Email app for the past couple of years to access my secure IMAP server. About a week ago, attempting to connect resulted in a certificate warning error due to a mismatched hostname. The host is a real one, but not one t

  • How to free up space on Mac Pro "other" Storage Category

    Shows 25.73GB free out of 150.18GB -- with 98GB in unknown "other" category. How do I locate those files and access them to try to clear up more space? Mac Pro 13, 10.9.5 IOS, 2.26 GHz Intel Core 2 Duo, Memor 8GB 1067 MHz DDR3, 8GB memory installed.