PHP/MySQL field recognize carriage returns?

I'm a novice PHP/MySQL database driven site builder. I need
to have users enter text into a field with carriage returns and
have the database recognize and store those carriage returns so it
displays when the data is displayed on a PHP page.
How do I do this and please keep it simple?
Do I need to use a particular type of MySQL datafield?
Will I be able to use the same code on an "update"
page?

quote:
Originally posted by:
geschenk
>>
so it displays when the data is displayed on a PHP page
>>
if you just need to replace the \n - type line breaks
generated by multiline textareas with <br /> on a page, just
use PHP´s native "nl2br"
(new line to break) function:
<?php echo nl2br($row_queryname['field_name']); ?>
That works... sort of...
When I use the update page to modify the entry it puts the
proper "br" code in it's proper place. However when I return to
that page to edit the text again (as my customer likely will), it
displays the "br" code in the text field, and if I submit the
update with the "br" code in place, it duplicates the "br" code
again, so I get double "br" statements. How do I get the update
field to read the "br" code back as carriage returns?
In addition, my insert page uses the following code to write
the original entry, and I'm not sure where to place the "nl2br"
statement in the following query (generated by WebAsssist DW
extensions):
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
$WA_connection = $nm_connect;
$WA_table = "tb_news";
$WA_sessionName = "WADA_Insert_tb_news";
$WA_redirectURL = "tb_news_Results.php";
$WA_keepQueryString = false;
$WA_indexField = "id";
$WA_fieldNamesStr =
"sort|s_head|s_text|head|subhead|bodytext|photoid|photocaption|name|phone|email|linktitle |linkaddress|show_pfm|show_arch|show_cab";
$WA_fieldValuesStr =
"".((isset($_POST["sort"]))?$_POST["sort"]:"") ."" . "|" .
"".((isset($_POST["s_head"]))?$_POST["s_head"]:"") ."" . "|" .
"".((isset($_POST["s_text"]))?$_POST["s_text"]:"") ."" . "|" .
"".((isset($_POST["head"]))?$_POST["head"]:"") ."" . "|" .
"".((isset($_POST["subhead"]))?$_POST["subhead"]:"") ."" . "|" .
"".((isset($_POST["bodytext"]))?$_POST["bodytext"]:"") ."" . "|" .
"".((isset($_POST["photoid"]))?$_POST["photoid"]:"") ."" . "|" .
"".((isset($_POST["photocaption"]))?$_POST["photocaption"]:"") .""
. "|" . "".((isset($_POST["name"]))?$_POST["name"]:"") ."" . "|" .
"".((isset($_POST["phone"]))?$_POST["phone"]:"") ."" . "|" .
"".((isset($_POST["email"]))?$_POST["email"]:"") ."" . "|" .
"".((isset($_POST["linktitle"]))?$_POST["linktitle"]:"") ."" . "|"
. "".((isset($_POST["linkaddress"]))?$_POST["linkaddress"]:"") .""
. "|" . "".((isset($_POST["show_pfm"]))?$_POST["show_pfm"]:"") .""
. "|" . "".((isset($_POST["show_arch"]))?$_POST["show_arch"]:"")
."" . "|" . "".((isset($_POST["show_cab"]))?$_POST["show_cab"]:"")
$WA_columnTypesStr =
"none,none,NULL|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',n one,''|',none,''|',none,''|',none,''|',none,''|none,none,NULL|none,none,NULL|none,none,NUL L";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_nm_connect;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj =
WA_AB_generateInsertParams($WA_fieldNames, $WA_columns,
$WA_fieldValues, -1);
$WA_Sql = "INSERT INTO " . $WA_table . " (" .
$insertParamsObj->WA_tableValues . ") VALUES (" .
$insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or
die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != ""
&& isset($_SERVER["QUERY_STRING"]) &&
$_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') ===
false)?"?":"&").$_SERVER["QUERY_STRING"];
header("Location: ".$WA_redirectURL);
?>

Similar Messages

  • Remove carriage returns from a field in an oracle table

    I have a field that is defined as a LONG in my oracle table; the data contained in this field has carriage returns/line feeds (it's free form text); as i'm selecting data from this field, i need the carriage returns removed so that the data from this field all appears on one line.
    I tried using the TRANSLATE function to convert the carriage returns to something else, but that doesn't work.
    Example:
    Select comment from Notes:
    COMMENT
    the applicant called for an appointment;
    an exam was scheduled for 4/1/05 at 9am;
    called applicant to confirm app
    this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled for 4/1/05 at 9am; called applicant to confirm app"
    How can i do this? Can the decode function be used to remove the carriage returns in this field?

    when i used translate its giving correctly,
    SQL> ed
    Wrote file afiedt.buf
    1 select translate('the applicant called for an appointment;
    2 an exam was scheduled for 4/1/05 at 9am;
    3 called applicant to confirm app
    4 this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled
    5 How can i do this? Can the decode function be used to remove the carriage returns in this field
    6* ',' ') from dual
    SQL> /
    TRANSLATE('THEAPPLICANTCALLEDFORANAPPOINTMENT;ANEXAMWASSCHEDULEDFOR4/1/05AT9AM;CALLEDAPPLICANTTOCONF
    the applicant called for an appointment; an exam was scheduled for 4/1/05 at 9am; called applicant t
    SQL> ed
    Wrote file afiedt.buf
    1 select 'the applicant called for an appointment;
    2 an exam was scheduled for 4/1/05 at 9am;
    3 called applicant to confirm app
    4 this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled
    5* How can i do this? Can the decode function be used to remove the carriage returns in this field
    SQL> /
    'THEAPPLICANTCALLEDFORANAPPOINTMENT;ANEXAMWASSCHEDULEDFOR4/1/05AT9AM;CALLEDAPPLICANTTOCONFIRMAPPTHIS
    the applicant called for an appointment;
    an exam was scheduled for 4/1/05 at 9am;
    called applicant to confirm app
    this needs to be extracted as: "the applicant called for an appointment; an exam was scheduled for 4
    How can i do this? Can the decode function be used to remove the carriage returns in this field?
    SQL>

  • Carriage Returns in Discoverer Viewer 10

    Hi,
    I have a Discoverer 10g report based on a view, within the view one of the fields is defined as:
    , pvs.address_line1||Chr(13)||Chr(10)
    ||pvs.address_line2||Chr(13)||Chr(10)
    ||pvs.address_line3||Chr(13)||Chr(10)
    ||pvs.city||Chr(13)||Chr(10)
    ||pvs.state||Chr(13)||Chr(10)
    ||pvs.zip||Chr(13)||Chr(10)
    …this returns multiple values in a single fields with carriage returns after each line, IE:
    NASH HOUSE
    OLD OAK LANE
    LONDON
    NW10 6DH
    This works fine within the database and also in Discoverer 10 Plus, however in Discoverer 10 Viewer the same record is displayed as:
    NASH HOUSE OLD OAK LANE LONDON NW10 6DH
    Is it possible to ‘configure’ Discoverer Viewer to display carriage returns?
    Regards
    Carl

    Hello Marias,
    To disable the warning message, Connect to the Admin Edition and navigate to Tools -> privilege -> click Select button and provide the username and hit GO button.
    Now in the "Desktop and plus privileges" section uncheck the option "Save workbooks to Database" and apply it.
    This will remove the privilege only to that particular user. To remove this privilege from all the users, select the public role and revoke the privilege.
    Hope this helps,
    Gianluca

  • Hold carriage returns in PHP MySQL database?

    I'm creating a limited news database for a not-for-profit
    site and I want to let admin users write a long entry which may
    include multiple paragraphs (i.e. carriage returns) and even bold
    text for subheadings would be nice. I haven't been able to find out
    the proper code and DB settings to allow users to do this.
    Anyone have a simple solution?

    The way I handle text formatting with dynamic data is to
    carefully construct
    your DB with formatting in mind
    Create separate fields for headlines and copy. When you call
    the data to
    your web page surround the heading with the desired tag. Of
    course you will
    not always have a heading, so, to eliminate empty spaces add
    a conditional
    statement to ignore the field if it is null.
    like this:
    database:
    news_id
    news_headline1
    news_copy1
    news_headline2
    news_copy2
    web page:
    <?php if (strlen($row_getNews['news_headline1']) > 0)
    {?>
    <h3><?php echo $row_getNews['news_headline1'];
    ?></h3>
    <?php }?>
    <p><?php echo $row_getNews['news_copy1'];
    ?></p>
    <?php if (strlen($row_getNews['news_headline2']) > 0)
    {?>
    <h3><?php echo $row_getNews['news_headline2];
    ?></h3>
    <?php }?>
    <?php if (strlen($row_getNews['news_copy2']) > 0)
    {?>
    <p><?php echo $row_getNews['news_copy2'];
    ?></p>
    <?php }?>
    Jeff
    "Justin from Indiana" <[email protected]>
    wrote in message
    news:fiimo4$33$[email protected]..
    > I'm creating a limited news database for a
    not-for-profit site and I want
    > to
    > let admin users write a long entry which may include
    multiple paragraphs
    > (i.e.
    > carriage returns) and even bold text for subheadings
    would be nice. I
    > haven't
    > been able to find out the proper code and DB settings to
    allow users to do
    > this.
    >
    > Anyone have a simple solution?
    >

  • Show if field is not empty - PHP/MySQL

    Is there a way I can only show bits of a page if a recordset
    has entries in a certain field, automatically hiding the area if
    the field is empty. (PHP/MySQL)
    To put it in real terms, I have loads of products listed in a
    repeating table. If a product has a photo gallery related to it
    there is a 1 entered in 'photos' field, it has a video attached
    here is a 1 entered in 'videos field and likewise for reviews it
    will have a 1 entered in the reviews field.
    What I'd like to have is a photo, video and review icon/link
    in the 'master table' which only appears in the repeated products
    that have a 1 listed in that field and have them not appear at all
    when there is a 0 in the field.
    Can anyone help me figure it out

    ADDT is certainly a great help, as it - among many other
    features - will allow you define whatever page element as
    "show/hide" based on a query result -- for this it´s using a
    so-called "condition builder" which lets you do that without
    coding.
    However you can achieve the same result without needing to
    resort to ADDT -- by using a basic "if" condition that´s
    checking the respective table column for having the value "1"
    stored, and if so, display the page segment
    The following 3 examples should work when replacing the
    sample "queryname" with the query name your page is actually using:
    <?php if ($row_queryname['photos'] == '1') {?>
    display photo icon here
    <?php }?>
    <?php if ($row_queryname['videos'] == '1') {?>
    display video icon here
    <?php }?>
    <?php if ($row_queryname['reviews'] == '1') {?>
    display videos icon here
    <?php }?>

  • - How do you refer to an HTML carriage return in PHP?

    Someone sent me a php script that replaces foul language with
    kinder words
    in message board postings. I'd like the same script to weed
    out carriage
    returns, but we can't find the correct syntax for it.
    We're using :
    $patterns[0] = '/\n\r/';
    What's the correct syntax to use in this situation?
    Thanks!

    "David Powers" <[email protected]> wrote in message
    news:[email protected]...
    > Reese wrote:
    >> "David Powers" <[email protected]> wrote in
    message
    >>>
    >>>$patterns[0] = '/[\n\r]/';
    >>>
    >>>That searches for either a newline character or a
    carriage return.
    >>
    >> I'm told this will only work in Windows. That Macs
    would require a
    >> different string. Two, even.
    >>
    >> Anyone know if this is true?
    >
    > What you have been told is only partly correct. Windows
    uses a carriage
    > return followed by a newline character (\r\n). Macs just
    use a newline
    > character (\n).
    >
    > The pattern I have given you search for either a newline
    character or
    > carriage return. So if it's applied in such a way as to
    remove all
    > instances, it will work on both Windows and Mac. An
    alternative pattern
    > which would also work on both is this:
    >
    > $patterns[0] = '/\r?\n/';
    >
    > It looks for an optional carriage return followed by a
    newline character.
    > In other words, it still matches if there isn't a
    carriage return.
    The response of my know-it-all roumanian programmer with an
    ego the size of
    Texas to that was :
    http://www.regular-expressions.info/characters.html
    (bottom of the page)
    \r\n = windows
    \n = Linux (not Mac)
    \r = Mac
    http://www.regular-expressions.info/optional.html
    (tells you what the '?'
    does)
    (it means that the character before it can be there 0 or 1
    times)
    \r?\n = \n (Linux) or \r\n (windows)
    It leaves out the \r all alone, like added by the Mac.
    So, it will not delete the Mac new lines (might delete the
    Mac OSX ones
    since that one is passed on Linux, but not the older ones.)
    Now, you can contradict me all you want and have a busted
    code (then you
    will say it doesn't work because I made it wrong), or do it
    like I told you
    and get it working like it should.
    To this, I told him I would present this to you for a
    rebuttal, but not
    before asking him why he used only the '/\r?\n/' model as an
    example, and
    not the recommended '/[\n\r]/'. Something tells me he has no
    idea what [
    and ] do in this context, so he's avoiding it altogether --
    even though it
    may very well solve the problem on its own the way you claim
    it does.

  • Can I generate a CR (Carriage Return) in a dynpro entry field ?

    My problem is the following
    I have a card reader and the information of this card will go into a SAP dynpro entry field.
    Now I need an addition CR (Carriage Return)
    Is that possible ?
    Thanks

    Basically this card reader is nothing more than any other barcode scanning or otherwise, so here is what I'm thinking.  At my old company, we had a bunch of barcode scanners which connected directly with SAP, the user would scan the barcode and it would put the value directly in the dynpro field.  This was great, but the user had to then hit enter.  There was no way for us to control this on the ABAP side.  We then discovered that in the barcode reader itself, there is some configuration around what is called a "postamble".  This is a keystroke which is fired automatically when a barcode is scanned, or maybe when a card is swiped?  Check your terminal and see if their is such a setting or configuration.
    Regards,
    Rich Heilman

  • How to replace an html br tag in the field to a carriage return?

    Hi All,
    I have a requirement to replace the <<br>> tag in the text field with a carriage return character "
    Currently the data in the Comments field looks like :
    "20100627 -115541 SECURITY WILL MEET AT MAIN ENTERANCE"<<<br>>"20100627 -115605 Officer notified: ALPHA : DF-10-011891; ST VINCENTS HOSPITAL, ST VINCENTS HOSPITAL, SAINT VINCENTS HOSP, MERRION RD, MERRION, BOOTERSTOWN, DUBLIN; FIRE/ALARM ACTIVATION;'<<br>>'20100627 -115609 PDA MOBILISED AFTER AMENDMENT VIN1'<<br>>'20100627 -"
    The <<br>> break tag was used for HTML purpose and now I would like to replace it with a carriage return character for BI Publisher report.
    Appreciate3 your help.
    Regards
    B
    Edited by: Bees on Jul 21, 2010 4:36 AM

    I downloaded your html template and it works fine for that template and the xml, but in my case it is not working. I need to assign the template just for one field called "Comments" where I need <<br>> tag to work.
    I modified the html as you suggested with the Tidy software, here is what I have done may be you can help me here. I very much appreciate your help.
    1. I have imported the template with the tag <<?import:file:///C:/dfb/biPub/code/htmlmarkup.xsl?>> and it works fine.
    2. Assigned the xsl - assign-template to the comments field.
    <xsl:apply-templates select="Fact._COMMENTS_" />
    *** IncidentsFact_._COMMENTS is the field name where it has <<br>><</br>> embedded into the comments data.
    Edited by: Bees on Jul 30, 2010 6:29 AM

  • Add a carriage return in a Unbound String Field

    Post Author: Razzle00
    CA Forum: Formula
    Hi,
         How can I add a carriage return to an unbound string field in a crystal report.  I am using the bundled version of CR with MS Visual Studio 2003 & 2005.  My formula needs to look something like this....
    'Heading One:' + CARRIAGE RETURN + trim({tablename.fld_1}) + CARRIAGE RETURN + 'Heading Two:' + CARRIAGE RETURN  + trim({tablename.fld_2})
    this code all needs to be in 1 unbound string field.  Is this possible?
    Thanks,
    Razzle

    Post Author: SKodidine
    CA Forum: Formula
    To add a carriage return, add CHRW(13)
    For example:
    'Heading One:' & chrw(13) & 'sample text';
    will result in:
    Heading One:
    sample text

  • Place a carriage return in the field separator of an iChart

    In the Data Mapping of an iChart, the Field Separator is a good tool to obviously separate data.  The problem I see is the two fields and the separator are on one line.  How can I place a carriage return to place the two fields on separator lines?

    Hi,
    This is not possible to do; however, perhaps it could be entered as a feature request for a later version.
    Diana Hoppe

  • IDoc output is not showing blank fields before the carriage return

    When we produce the Material Master IDoc (MATMAS), we send it to a ascii file, to a file port.  That works fine when we execute BD10 to produce the IDoc and the file.  But, the 3rd party mapping software wants to see every field, even if blank, in each segment it is fed.  So, let's say the E1MARCM segment is 750 chars, when you add up all the field lengths in the structure, but the last 5 fields are blank.  SAP does not include those trailing blanks at the end of the segment in the file.  It just puts a carriage return.  How can we configure it to output the trailing blanks?

    Hi Mark Mathison 
    In IDoc ....if no value is passed in to that field then, the field wonu2019t be populated in Doc....
    There is no chance of getting blank field in IDocs...
    Ramesh

  • Exporting Text data from PHP to Oracle CLOB data (Carriage return - issue)

    This is my original text content in PHP - Data type - Longtext
    SECTION - 1
    This a test description.This a test description.
    This a test description.This a test description.
    This a test description. This a test description.I exported the above content from PHP as a SQL script file (insert into.. ) - export.sql [ insert into table_name (id, text_content) values (1, '') ]
    while exporting data from PHP table into export file.. it replaced the "Carriage return" with "\r\n\r\n" in the insert statement for text_content column
    When I run this INSERT statement in Oracle (for longtext, I have created a CLOB column in Oracle), the following text_content data is inserted into CLOB column in Oracle.
    SECTION - 2
    This a test description.This a test description.\r\n\r\nThis a test description.This a
    test description.\r\n\r\nThis a test description.This a test description.Now I have created a item named P1_TEXT_CONTENT of type TEXTAREA and try to fetch the CLOB data into this page item.
    BUT textarea displays the entire content including "\r\n\r\n" as mentioned in SECTION - 2
    I want to display the content in textarea (item - P1_TEXT_CONTENT) without "\r\n\r\n" same as the original content with "Carriage return" as mentioned in SECTION - 1
    What are the options we have?
    Thanks,
    Deepak

    DeepakJ wrote:
    I want to display the content in textarea (item - P1_TEXT_CONTENT) without "\r\n\r\n" same as the original content with "Carriage return" as mentioned in SECTION - 1
    What are the options we have?Run an update on the Oracle table following the inserts to replace the escaped CR/LFs with real ones:
    update foo
    set clob_column = replace(clob_column, '\r\n', chr(13) || chr(10));You might want to experiment to see which characters are actually necessary. As an OS X/Linux user I'd probably just use a single LF chr(10).

  • Serious Bug - Carriage Returns in Caption field

    LR for Windows does not handle Carriage Returns/Line Feeds correctly in the metadata Caption field.
    Windows Vista SP1, 32-bit
    Adobe Lightroom 2.4
    Library Module, Grid View
    Initial settings:
    LR Menu bar > Edit > Catalog Settings... > Metadata tab > Editing
    uncheck Offer suggestions from recently entered values
    uncheck Automatically write changes into XMP
    LR Menu bar > View > View options... > Grid View tab > Cell Icons
    check Unsaved Metadata
    Metadata panel: choose the Default Metadata Set.
    Import a JPG file into LR which contains no IPTC metadata.
    LR Menu bar > File > Import Photos from disk... > Choose the JPG file
    In the Import Photos dialog box, Information to Apply:
    Develop Settings: None
    Metadata: None
    Keywords: None
    Click Import.
    Click thumbnail of the JPG file which was Imported.
    In the Metadata panel click Caption field.
    Type "Word1" in the Caption field and press Return/Enter key.
    The Caption field loses focus.
    The Caption field should not lose focus when the Return/Enter key is pressed.
    Click the Caption field and press the Delete key to remove "Word1" from the field.
    In the Caption field type "Word1" and press Ctrl+Return/Enter key.
    As expected, the cursor moves to the line below "Word1" and the Caption field remains in focus.
    Type "Word2" and press Ctrl+Return/Enter key.
    As expected, the cursor moves to the line below "Word2" and the Caption field remains in focus.
    Click the JPG thumbnail and notice a down-arrow icon appears on the thumbnail indicating that the metadata for this JPG has been changed in the LR catalog and that it does not match the IPTC metadata that is embedded in the JPG file on the hard disk. Also notice in the Metadata panel, Metadata Status is "Has been changed".
    Click the down-arrow on the JPG thumbnail.
    See the dialog box that pops up saying "The metadata for this photo has been changed in Lightroom. Save the changes to disk?"
    Click Save.
    Notice on the JPG thumbnail, the down-arrow icon remains visible and does not disappear as it should if the JPG's metadata in the LR catalog and the metadata embedded in the JPG file on the hard disk were the same.
    Also notice in the Metadata panel, Metadata Status is "Has been changed".
    Click LR Menu bar > Edit > Catalog Settings... > Metadata tab > Editing
    check Automatically write changes into XMP
    Click OK.
    Notice on the JPG thumbnail, the down-arrow icon blinks rapidly. Also notice in the Metadata panel that "Metadata Status: Has been changed" blinks rapidly.
    Click LR Menu bar > Edit > Catalog Settings... > Metadata tab > Editing
    uncheck Automatically write changes into XMP
    Notice the blinking stops.
    Using a program that properly handles Carriage Returns/Line Feeds in IPTC metadata, such as Photo Mechanic 4.5, edit the metadata of another JPG file by typing "Word1", pressing the Return/Enter key, and typing "Word2" in the Caption field.
    Import that JPG into LR.
    LR Menu bar > File > Import Photos from disk... > Choose the JPG file
    In the Import Photos dialog box, Information to Apply:
    Develop Settings: None
    Metadata: None
    Keywords: None
    Click Import.
    Click the JPG thumbnail in LR Library Module.
    Notice in the Metadata panel, "Word1Word2" appears in the Caption field, in both the Default Metadata Set and the Large Caption Metadata Set. The CR/LF has been stripped away.
    CR/LFs typed into or pasted into the Large Caption set, also result in the persistence of the down-arrow icon even after metadata is saved to disk. And, if the Automatically write changes into XMP option is checked, the down-arrow icon blinks rapidly. And, if you view the Default set, notice Metadata Status: "Has been changed" blinks rapidly.
    When metadata is saved to disk, the down-arrow icon should disappear from the thumbnail, and in the Metadata panel, Metadata Status should read "Up to date". I would guess the blinking behavior indicates LR is stuck in some kind of loop - it is trying to save the metadata to disk and verify that it has been saved, but it keeps going round in a vicious circle. I also notice there is increased hard drive activity during the blinking behavior.

    Here is a related problem (using Lightroom 3.3, Windows).  When I import photos that have the IPTC caption field created in another program (ThumbsPlus, or IrfanView), carriage returns in the original do not show up in Lightroom.  Does anyone know why, or what to do about it?  I'd like to import lots of photos with existing captions, and some have carriage returns I would like to retain.
    For me, adding a carriage return to the Caption metadata within Lightroom works fine.  In the Library view, using the right panel, I can enter a carriage return using Ctrl+Enter in the Metadata > Default view or in the Metadata > IPTC view.  I can enter a carriage return directly with the Enter key (no Ctrl required) in the Metadata > Large Caption view.  After these entries are saved to the file, they show up correctly in other programs (IrfanView > Image > Properties > IPTC Info)

  • How to handle carriage return/linefeed embedded in text field as first char

    Hi,
    I am trying to use sqlldr to import text that is comma-separated and double quote-enclosed, but contains embedded carriage return/linefeed pairs. I have a control file which works for most cases and looks like this:
    LOAD DATA
    INFILE './foo.new'
    APPEND
    CONTINUEIF LAST PRESERVE (<>'"')
    INTO TABLE <tablename>
    FIELDS TERMINATED BY "," ENCLOSED BY '"'
    TRAILING NULLCOLS
    Unfortunately, this fails when the very first character of the text field is a carriage return/linefeed pair, e.g.,:
    "11","22","33","\r\nThis is the fourth field","","","","",""
    In that case, what is actually the opening double-quote for the fourth field, is interpreted by the CONTINUEIF clause as the end of that line. Can anyone please point me to a solution?
    thanks.
    stan.

    Thanks for the suggestion. Unfortunately, I've already tried it, and it doesn't help. I believe the problem is that sqlldr tries to figure out where each record is delimited before it parses out the field. So, any field-level trimming depends on sqlldr first determining that the cr/lf is actually part of that record, and not an indication of the start of a new record (and it's doing the latter right now). Fwiw, Python's csv parser will handle this type of record just fine.
    regards.
    stan.

  • Carriage Returns in Textarea field in APEX Mail

    Greetings all,
    I have a form that the users fill out and when they click submit it uses APEX Mail to send the contents to individuals in an HTML format. One of the fields is a text area where the individual will enter information like the sample below:
    First to Arrive:  Bob
    Second to Arrive: Jane
    Third to Arrive: Sandy
    Last to Arrive: FredWhen the email is received, instead of being on one line, each entry follows the next like:
    First to Arrive: Bob Second to Arrive: Jane Third to Arrive: Sandy Last to Arrive: Fred
    I posted about getting the form fields to show the carriage returns and that works fine. Now trying to figure out what to add to make sure that line breaks are handles as html breaks br tags. Any assistance and examples would be appreciated.
    Thanks
    Wally
    Edited by: wfsteadman on Feb 17, 2011 4:49 PM

    3.  Re: Carriage Returns in Textarea field in APEX Mail
           617301
    this code looks like it should work but doesnt,
    REPLACE(REPLACE(REPLACE(:TEXT_FIELD_ITEM,CHR(10)||CHR(13),'&lt;br/&gt;'),CHR(10),'&lt;br/&gt;'),CHR(13),'&lt;br/&gt;')
    ....thanks.

Maybe you are looking for

  • How to set a background image in Web dynpro for Java?

    Hi, Experts, As i  want to set a background image in my application can u please suggest how to get background image. send any sample scenarios. Thanks in advance, Shabeer ahmed

  • Looking for an (old?) app...

    Hi, a year ago I saw an app on a website that enabled you to move windows by holding a hotkey and dragging the mouse; the window would stay below the cursor, and this could save you some time because you don't have to be so precise. But it was PPC on

  • Since updating iTunes, not recognizing/syncing my iPhone5.

    Followed first set of steps to correct this problem, but nothing. Now asking for me to delete iTunes and start again. Should I do this? Worried I will lose my music not purchased but added. Help!!!

  • Report Painter for PP reports

    Hi there , Can any one please help me in learning how we can prepare reports using report painter ... please share with me the any learning document & resource from where I Can learn the same ... Secondly, do we use report painter for PP rather SCM r

  • The zend framework in FB4 works with PostgreSQL?

    Hi, first, I'm sorry if I'm in the incorrect forum jeje, i'm new in this forum. I would like to know if the zend framework in flash builder 4 can work with PostgreSQL, and if there's a tutotial about how to do. Thanks. Greetings.