How to handle line break embeded inside CSV column

Hi there,
I am under the pressure to make it work. I already put this question on APEX forum, but on second thought, I think it relates more to PL/SQL rather than APEX since APEX 4.1 already have utility to handle CSV Upload.
If you read it already in APEX forum, please ignore.
I am sorry for that. Thanks for reading.
I need to develop an app that allows user to upload CSV file to a interface table.
The APEX version at my workplace is 4.0.2.
I used the code from
http://dbswh.webhop.net/htmldb/f?p=BLOG:READ:0::::ARTICLE:11000346061523
It all works well till recently I find out
If a column in a CSV file cotain a line break (or new line) e.g. (The tester copy and paste this text which has line break into a column in a spreadsheet)
This is the first sentence.
This is the second sentence.
It will break the “This is the second sentence”. To a new column.
The contents of the CSV viewed in Notepad look as below
Assessment Date,Scheduled Date,Assessment Provider,Assessor Name,Court,First Name,Middle Name,Last Name,PRN Person Record Number,NHI Number,Defendant Attended Y/N,Is Dependent Y/N,Notes,Primary Ethnicity,"Ethnicity Other, please specify",Gender,Currently in Treatment Y/N,Substance of Concern 5,Other Substance Specified
22/09/2012,,Provider Co Name,Warren Edgley,Wellington,,,Salty,2545554,dgsdf,ergerg,,"This is the first sentence.
This is the second sentence.",Japanese,,Female,b,,
Here is the code from the CSV UTIL, please help me to find out how can I replace the line break to a space so that the uploading process is correct.
  CREATE OR REPLACE PACKAGE BODY "CSV_UTIL"
AS
     --strip the beginning and the end quotes, then replace double quotation with single
   FUNCTION de_quote (p_str IN VARCHAR2, p_enc_by IN VARCHAR2)
      RETURN VARCHAR2
   IS
   v_str VARCHAR2(32767) := p_str;
   BEGIN
      IF (p_enc_by IS NULL)
      THEN
         RETURN p_str;
      ELSE
        IF SUBSTR(p_str,-1) = p_enc_by THEN
           v_str := SUBSTR(p_str,1,LENGTH(p_str)-1);
        END IF;
        IF SUBSTR(p_str,1,1) = p_enc_by THEN
           v_str := SUBSTR(v_str,2);
        END IF; 
        RETURN REPLACE (v_str,
                         p_enc_by || p_enc_by,
                         p_enc_by
      END IF;
   END de_quote;
   PROCEDURE parse (p_str IN VARCHAR2, p_enc_by IN VARCHAR2, p_sep IN VARCHAR2)
   IS
      l_n          NUMBER   DEFAULT 1;
      l_in_quote   BOOLEAN  DEFAULT FALSE;
      l_ch         NCHAR (1);
      l_len        NUMBER   DEFAULT NVL (LENGTH (p_str), 0);
   BEGIN
      IF (l_len = 0)
      THEN
         RETURN;
      END IF;
      g_words := g_empty;
      g_words (1) := NULL;
      FOR i IN 1 .. l_len
      LOOP
         l_ch := SUBSTR (p_str, i, 1);
         IF (l_ch = p_enc_by)
         THEN
            l_in_quote := NOT l_in_quote;
         END IF;
         IF (l_ch = p_sep AND NOT l_in_quote)
         THEN
            l_n := l_n + 1;
            g_words (l_n) := NULL;
         ELSE
            g_words (l_n) := g_words (l_n) || l_ch;
         END IF;
      END LOOP;
      g_words (l_n) := de_quote (g_words (l_n), CHR(10));
      g_words (l_n) := de_quote (g_words (l_n), CHR(13));
      FOR i IN 1 .. l_n
      LOOP
         g_words (i) := de_quote (g_words (i), p_enc_by);
      END LOOP;
   END parse;
Author: Oleg Lihvoinen
Company: DbSWH
Changes:
10.02.2011, There was a miscalculation of the file line last position in case it is the end of file
   PROCEDURE upload (p_file_name VARCHAR2, p_collection_name VARCHAR2, p_enc_by IN VARCHAR2, p_sep_by IN VARCHAR2, p_rows NUMBER)
   IS
      v_blob_data    BLOB;
      v_clob_data    CLOB;
      v_clob_len     NUMBER;
      v_position     NUMBER;
      v_char         NCHAR (1);
      c_chunk_len    NUMBER           := 1;
      v_line         VARCHAR2 (32767) := NULL;
      v_data_array   vcarray;
      v_rows         NUMBER           := 0;
      n_seq          NUMBER           := 1;
      dest_offset    NUMBER           := 1;
      src_offset     NUMBER           := 1;
      amount         INTEGER          := DBMS_LOB.lobmaxsize;
      blob_csid      NUMBER           := DBMS_LOB.default_csid;
      lang_ctx       INTEGER          := DBMS_LOB.default_lang_ctx;
      warning        INTEGER;
      l_sep          VARCHAR2(100)    := CASE WHEN p_sep_by = '\t' THEN chr(9) ELSE p_sep_by END;
   BEGIN
      htmldb_collection.create_or_truncate_collection
                                      (p_collection_name      => p_collection_name);
      -- Read blob from wwv_flow_files
      SELECT blob_content
        INTO v_blob_data
        FROM wwv_flow_files
       WHERE NAME = p_file_name;
      v_position := 1;
      DBMS_LOB.createtemporary (lob_loc      => v_clob_data,
                                CACHE        => TRUE,
                                dur          => DBMS_LOB.SESSION
      DBMS_LOB.converttoclob (v_clob_data,
                              v_blob_data,
                              amount,
                              dest_offset,
                              src_offset,
                              blob_csid,
                              lang_ctx,
                              warning
      v_clob_len := DBMS_LOB.getlength (v_clob_data);
      IF v_clob_len = 0 THEN
         RETURN;
      END IF;
      WHILE (v_position <= v_clob_len + 1)
      LOOP
         v_char := DBMS_LOB.SUBSTR (v_clob_data, c_chunk_len, v_position);
         v_line := v_line || v_char;
         v_position := v_position + c_chunk_len;
         -- When the whole line is retrieved and not end of file or end of file
         IF v_char = CHR (10) AND v_position < v_clob_len OR v_position = v_clob_len + 1
         THEN
            parse (p_str => v_line, p_enc_by => p_enc_by, p_sep => l_sep);
            v_data_array := g_words;
            FOR i IN 1..g_words.count LOOP
               IF i <= 50 THEN
                  v_data_array(i) := g_words(i);
               ELSE
                  exit;
               END IF;
            END LOOP;
            FOR i IN g_words.count + 1..50 LOOP
               v_data_array(i) := null;
            END LOOP;           
            v_rows := v_rows + 1;
            -- exit if uploaded specified number of rows
            IF p_rows IS NOT NULL AND v_rows > p_rows THEN
               EXIT;
            END IF;
            -- Store data to collection
            n_seq :=
               htmldb_collection.add_member
                                     (p_collection_name      => p_collection_name,
                                      p_c001                 => v_data_array
                                                                           (1),
                                      p_c002                 => v_data_array
                                                                           (2),
                                      p_c003                 => v_data_array
                                                                           (3),
                                      p_c004                 => v_data_array
                                                                           (4),
                                      p_c005                 => v_data_array
                                                                           (5),
                                      p_c006                 => v_data_array
                                                                           (6),
                                      p_c007                 => v_data_array
                                                                           (7),
                                      p_c008                 => v_data_array
                                                                           (8),
                                      p_c009                 => v_data_array
                                                                           (9),
                                      p_c010                 => v_data_array
                                                                           (10),
                                      p_c011                 => v_data_array
                                                                           (11),
                                      p_c012                 => v_data_array
                                                                           (12),
                                      p_c013                 => v_data_array
                                                                           (13),
                                      p_c014                 => v_data_array
                                                                           (14),
                                      p_c015                 => v_data_array
                                                                           (15),
                                      p_c016                 => v_data_array
                                                                           (16),
                                      p_c017                 => v_data_array
                                                                           (17),
                                      p_c018                 => v_data_array
                                                                           (18),
                                      p_c019                 => v_data_array
                                                                           (19),
                                      p_c020                 => v_data_array
                                                                           (20),
                                      p_c021                 => v_data_array
                                                                           (21),
                                      p_c022                 => v_data_array
                                                                           (22),
                                      p_c023                 => v_data_array
                                                                           (23),
                                      p_c024                 => v_data_array
                                                                           (24),
                                      p_c025                 => v_data_array
                                                                           (25),
                                      p_c026                 => v_data_array
                                                                           (26),
                                      p_c027                 => v_data_array
                                                                           (27),
                                      p_c028                 => v_data_array
                                                                           (28),
                                      p_c029                 => v_data_array
                                                                           (29),
                                      p_c030                 => v_data_array
                                                                           (30),
                                      p_c031                 => v_data_array
                                                                           (31),
                                      p_c032                 => v_data_array
                                                                           (32),
                                      p_c033                 => v_data_array
                                                                           (33),
                                      p_c034                 => v_data_array
                                                                           (34),
                                      p_c035                 => v_data_array
                                                                           (35),
                                      p_c036                 => v_data_array
                                                                           (36),
                                      p_c037                 => v_data_array
                                                                           (37),
                                      p_c038                 => v_data_array
                                                                           (38),
                                      p_c039                 => v_data_array
                                                                           (39),
                                      p_c040                 => v_data_array
                                                                           (40),
                                      p_c041                 => v_data_array
                                                                           (41),
                                      p_c042                 => v_data_array
                                                                           (42),
                                      p_c043                 => v_data_array
                                                                           (43),
                                      p_c044                 => v_data_array
                                                                           (44),
                                      p_c045                 => v_data_array
                                                                           (45),
                                      p_c046                 => v_data_array
                                                                           (46),
                                      p_c047                 => v_data_array
                                                                           (47),
                                      p_c048                 => v_data_array
                                                                           (48),
                                      p_c049                 => v_data_array
                                                                           (49),
                                      p_c050                 => v_data_array
                                                                           (50)                                                                          
            -- Clear the line
            v_line := NULL;
         END IF;
      END LOOP;
   END;
END;In my apps, I save these straight into a table rather than an APEX collection because the number of columns can be longer than 50.
I want to find out how can replace these line break inside a column to a space.
If any one has any ideas, please let me know.
Thanks a lot in advance.
Ann

Ann586341 wrote:
I think the code split the whole thing by this line
-- When the whole line is retrieved and not end of file or end of file
IF v_char = CHR (10) AND v_position < v_clob_len OR v_position = v_clob_len + 1
THEN
Yes, exactly. That piece of code believes all CHR(10) occurences are record delimiters.
It is not smart enough to recognize that a CHR(10) within quotation marks are part of the data.
Optimally a solution should keep the CHR(10) rather than replacing with spaces, but that will be a bigger rewrite of the UTL_CSV code ;-)
If you are happy with replacing with spaces, a "simple" solution could be something like:
Declare a boolean variable in upload procedure:
v_within_text_column   boolean := false;And use it like this:
      WHILE (v_position <= v_clob_len + 1)
      LOOP
         v_char := DBMS_LOB.SUBSTR (v_clob_data, c_chunk_len, v_position);
         IF v_char = '"' THEN
           v_within_text_column := NOT v_within_text_column;
         ELSIF v_char = CHR(10) AND v_within_text_column THEN
           v_char := ' ';
         END IF;
         v_line := v_line || v_char;
         v_position := v_position + c_chunk_len;
         -- When the whole line is retrieved and not end of file or end of file
         IF v_char = CHR (10) AND v_position < v_clob_len OR v_position = v_clob_len + 1
         THEN
           v_within_text_column := false; -- To be safe always set this on "true" linebreaks
{code}
+(This is untested code just written here in the text editor.)+
It should work by toggling a flag whether you are "within" the quotes or not and then replacing CHR(10) with a space if you are within a text column.
This way we avoid having to go through the clob more than once (it is enough that this code walks the clob one character at a time...)
It will not handle if the clob contains situations like:
{code}
abc,123,"This is a text with a quote from a man who said \"To Be,
or Not To Be\" some hundred years ago",123,xyz
{code}
Escaped quotes would need separate attention ;-)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • How to avoid line break ( br ) while exporting Interactive report in Excel

    Hi,
    I have a Interative report and I am using Apex download format as CSV.
    I have defined some of the column heading in multiple line using break < br >
    when I export this into the excel sheet..the column heading contains break also..
    - Any idea how to avoid line break while exporting in excel.
    - also how to put the columns heading in BOLD when exported in excel.
    Thanks,
    Deepak

    Hi Jari,
    I tried this but still getting the
    <br>Interactive Report
    Column Attributes Heading - Employee<br>Detail AddressWhen I download the Report in CSV Format
    I am getting the heading with <br>.
    I am looking for heading as - Employee Detail Address // with no <br> tagThanks,
    Deepak

  • File adapter-How to set line break in text file-split record into two lines

    Dear Guru's,
    I have to solve following problem with XML (with mulitiple records) to TEXT file scenario using file adapter. I have to output for ever ONE data record in XML always two identical lines in text file. Second line should have a little bit different mapping in few fields like date,... So I did duplicate fileds in my output structure in mapping and need to know how to set line break in the middle and see half of structure in first line and next structure half in second line
    My output structure in mapping is:
    CASHFLOW
    - INTERFACE
    - GESELLSCHAFT
    - ANWENDUNG
    - PRODUKT
    - VERTRAG
    - BETRAG
    - WAEHRUNG
    - DIRECTION
    - BEWEGUNGSTYP
    - FAELLIGKEIT
    - ZINSFESTSTELLUNG
    - ZAHLUNGSTAG
    - RENDITE
    - INTERFACE2
    - GESELLSCHAFT2
    - ANWENDUNG2
    - PRODUKT2
    - VERTRAG2
    - BETRAG2
    - WAEHRUNG2
    - DIRECTION2
    - BEWEGUNGSTYP2
    - FAELLIGKEIT2
    - ZINSFESTSTELLUNG2
    - ZAHLUNGSTAG2
    - RENDITE2
    Question is how can I set on receiving file adapter in Content Conversion Parameters that fields from first structure half INTERFACE...RENDITE should be outputed in one line and fields from second half of structure INTERFACE2...RENDITE2 should start on second line in final text file.
    I'm getting at the moment one line only and I need to know how can set line break so that second line starting with INTERFACE2(CA)...RENDITE2 will start in new line.
    CA,"0100","7","512",20090127010001,-12454762586.6800,"EUR",2,12,2009-01-28,2009-01-27,2009-01-28,"0.0000000",CA,"0100","7","512",20090127010001,-12454762586.6800,"EUR",1,10,2009-01-27,2009-01-27,2009-01-27,"0.0000000"
    This should be final output:
    CA,"0100","7","512",20090127010001,-12454762586.6800,"EUR",2,12,2009-01-28,2009-01-27,2009-01-28,"0.0000000"
    CA,"0100","7","512",20090127010001,-12454762586.6800,"EUR",1,10,2009-01-27,2009-01-27,2009-01-27,"0.0000000"
    My file adapter settings:
    RecordsetStructure=CASHFLOW
    CASHFLOW.fieldNames=INTERFACE,GESELLSCHAFT,ANWENDUNG,PRODUKT,VERTRAG,BETRAG,WAEHRUNG,DIRECTION,BEWEGUNGSTYP,FAELLIGKEIT,ZINSFESTSTELLUNG,ZAHLUNGSTAG,RENDITE
    CASHFLOW.fieldSeparator=,
    CASHFLOW.endSeparator='nl'
    CASHFLOW.fieldNames=INTERFACE2,GESELLSCHAFT2,ANWENDUNG2,PRODUKT2,VERTRAG2,BETRAG2,WAEHRUNG2,DIRECTION2,BEWEGUNGSTYP2,FAELLIGKEIT2,ZINSFESTSTELLUNG2,ZAHLUNGSTAG2,RENDITE2
    CASHFLOW.fieldSeparator=,
    It wont help if I add two identical structures in mapping because in output i would see for multiple entries section with first lines only and after that section with second lines only. And CASHFLOW is one part of more complex mapping ...
    (This is final output structure RecordsetStructure=HEADER,CASHFLOW,CONDITION,REFERENCE,CONTRACT - more sections with different data and all these should have duplicate lines at the end)
    Thanks a lot for any help
    Cheers
    Marian
    Edited by: Marian  Luscon on Jul 14, 2009 11:44 AM

    Hi Ivan,
    right, I did test just for sure.
    Putting constant 'nl' into field CASHFLOW-INTERFACE1 didnt help - still getting one line instead two lines.
    CA ,"0100" ,"7" ,"512" ,20090127GTP101 ,-12454762586.6800 ,"EUR" ,2 ,12 ,2009-01-28 ,2009-01-27 ,2009-01-28 ,"0.0000000" ,'nl' ,"GTP1" ,"7" ,"512" ,20090127GTP101 ,-12454762586.6800 ,"EUR" ,1 ,10 ,2009-01-27 ,2009-01-27 ,2009-01-27 ,"0.0000000"
    So there is still question. Is there any way (mapping,...) how to output always 2 lines in text file for one record in XML. It always does 1 record in mapping structure = 1 line but we need 2 lines ...
    Example:
    Input: 4 records in XML
    Output: 8 lines in final text file ...
    Thanks to you all guys
    Marian

  • VSTO: How to set line break in Ribbon Xml?

    Hi All,
    I have a button in Ribbon.xml. it looks like:
            <group label="myLabel" id="View">
              <checkBox id="cbView" label="ViewViewviewviewview" getPressed="cbView_Pressed"/>
            </group>
    The result is shown as:
    The checkbox is too long. My question is : How to set line break in checkbox's label.
    Thanks a lot,
    By the way, in Ribbon Xml. How to add RadioButton?

    Hello Ricky,
    The Fluent UI (aka Ribbon UI) doesn't provide any attribute or callback for that. You can try to use an escape sequence "\n\r", but I am not sure whether it helps. Also you may consider placing a text block below the check box control.
    You can read more about the Ribbon UI in the following series of articles:
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

  • How to handle newline within quotes in csv

    Hello experts,
    I have an issue with reading a csv file which contains newline as a part of one of the fields (within double quotes).
    I'm using the file content conversion in sender file adapter with the following
    NameA.fieldNames = field1, field2, field3, field4
    NameA.fieldSeparator = ,
    NameA.processFieldNames = fromConfiguration
    NameA.enclosureSign = "
    NameA.enclosureSignEscape = ""
    NameA.endSeparator = 'nl'
    This doesn't work. The sender channel treats the newline within double quotes as a new record and is not reading the file correctly.
    I though the NameA.enclosureSign and NameA.enclosureSignEscape parameters would do the trick and ignore text that's between the double quotes?
    An I missing some Content conversion cofiguration here? Some parameter that I need to set?
    Please help resolve this.
    Thanks
    Karthik

    Hi,
    I have a scenario similar to this.
    ClaimsRecords.fieldNames  :  CompanyName,Invoice,InvoiceDate....,Location Name,...
    ClaimsRecords.fieldSeparator  :  ,
    ClaimsRecords.enclosureSign  :  "
    ClaimsRecords.endSeparator  :  'nl'
    The sample file will look like this:
    XYZ,123,21122011,......,"Delhi
    India",312,...
    ABC,234,22122011,......,"Bangalore
    India",432,....
    The new line character comes inside the value of the LocationName field. But the above entries made in FCC will handle this kind of file correctly.
    Recheck the FCC entries and even check if the file is coming in correct format.
    Regards,
    Aravind

  • How to set line break points in JSF Facelets files on NetBeans?

    I am running debugger on NetBeans. I can set line break points for jsp files but cannot for Facelets files with extension 'xhtml'. Dose anybody know how to set break points for Facelets xhtml files? Or is it possible to set break points for xhtml filles?
    Thank you very much.

    You can't. They aren't executable code, they are templates. The only executable code is the part inside #{}.

  • Handling Line breaks in Oracle XML Publisher

    Hi,
    I’m developing a XML Publisher report.The data definition file has a tag which contains line breaks(\n- new line).
    How to handle this logic in RTF template?
    For Example:
    XML tag:
    <CF_LONG_TEXT>Final Adjusted Total Costs: $0.00 \n Less: Initial Billing Amount - $(1.65) - Invoice # 100000 \n \n Final Billing Amount: $0.88 \n \n Computation: \n a) Adjusted Number of Full-Time Students: 2,877 </CF_LONG_TEXT>
    Desired Output:
    Final Adjusted Total Costs: $0.00
    Less: Initial Billing Amount - $(1.65) - Invoice # 100000
    Final Billing Amount: $0.88
    Computation:
    a) Adjusted Number of Full-Time Students: 2,877
    Thanks,
    Sri.

    Hi,
    Please try giving this:
    <xs:attribute name="space" default="preserve">
                          <xs:simpleType>
                              <xs:restriction base="xs:NCName">
                                 <xs:enumeration value="default"/>
                                 <xs:enumeration value="preserve"/>
                               </xs:restriction>
                          </xs:simpleType>
                    </xs:attribute>
    Regards
    Suraj

  • How to put line break in the text

    Hi guys,
    This is a simple problem.i don't know how to concat a line break while creating a text.
    I am looping through the results of a query and want to form the text using the results.
    For each row of the resultset,I want to create a new line in the text i create.
    I was wondering how to put a new line in the text.
    I thought I can concat '\n' ,but it does not work.
    the code snippet in the procedure is :
    for c1_rec in c1 loop
    vMsg := ' There are ' || c1_rec.total ||
         ' documents of type ' || c1_rec.doc_type || '\n' ;
    end loop;
    Please give the solution.
    Thanks in advance.

    Thank you Mark.
    I tried your suggestion.But line break is not working in email.
    Here is how my code is
    in procedure 1 ,i create the message String as :
    for c1_rec in c1 loop
    vMsg := vMsg || ' ' || today_str || ' - ' || c1_rec.total ||
         ' Total inbound documents from : ' || c1_rec.target_value || CHR(13)||CHR10) ;
    dbms_output.put_line(' ' || vMsg);
    end loop;
    --here sending mail calling another procedure
    sendmail( '[email protected]' ,'[email protected]' , 'Test Subject ' , vMsg );
    In Procedure 2( i.e sendmail procedure )
    i am preparing email server connection from and to adresses .Then i am preparing and sending message as
    crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
    conn:= utl_smtp.open_connection( EmailServer, Port );
         utl_smtp.helo( conn, EmailServer );
         utl_smtp.mail( conn, SENDER);
         utl_smtp.rcpt( conn, RECEIVER )
    mesg:= 'Subject: ' || SUBJECT || crlf ||
                   'Date: '||TO_CHAR( SYSDATE, 'Dy, dd Mon yyyy hh24:mi:ss' )||
                   crlf ||
                   'From:'||SENDER|| crlf ||
                   'To: '||RECEIVER || crlf ||
                   'Content-Type: text/html; charset=ISO-8859-1' || crlf ||
                   '' || crlf || MESSAGE ;
         utl_smtp.data( conn, mesg );
         utl_smtp.quit( conn );
    even now the mail we are getting is not having the line break.I am having line break in dbms output,but not in the mail.
    Is there any mistake how I am sending the mail.Or is there any other way we can put line break in the text
    Thank you.

  • How to replace line break for comma

    Hi there,
    i have a string which is like
    header1,value1,header2,value2,header3,value3,header4,value4now i have to write the above string to a file which should be like
    file.txt should be
    header1,value1
    header2,value2
    header3,value3
    header4,value4i can write the string to a file easy, but i need to make the every even number , to line break.
    any help
    Thanks
    R

    You may get a better way, but this is how I would do this:
    -- split the string on comma
    -- iterate through the array using a for i+=2 loop and concatenate every pair of strings with comma-space between.
    db
    edit And write the results to a new array of half the length, of course. Then write the new array to the file.
    Edited by: Darryl.Burke

  • [solved] How to have line breaks in output of journalctl log

    Hello,
    How can I have line breaks in the journalctl log output?
    At the moment I cannot read most of the log output because it does not fit into my terminal.
    See this screenshot: http://i.imgur.com/nUR6Fae.png
    Thanks!
    Last edited by orschiro (2013-09-20 08:08:04)

    You can run
    journalctl -b --no-pager | less
    Edit: If you hit 'h' you get help screen
    SUMMARY OF LESS COMMANDS
    <snip>
    ESC-) RightArrow * Left one half screen width (or N positions).
    ESC-( LeftArrow * Right one half screen width (or N positions).
    <snip>
    It may be possible to configure the way the journal uses the pager so it wraps the lines by default.
    Edit 2: Or maybe it can't be configured.
    man journalctl wrote:The output is paged through less by default, and long lines are "truncated" to screen width. The hidden part can be viewed by using the left-arrow and right-arrow keys. Paging can be disabled, see --no-pager and section Environment below.
    Last edited by karol (2013-09-20 08:02:13)

  • How to include Line break in string?

    Hello Experts,
    I have a requirement like, I have to display the string value in 2 lines in Web UI.
    I have achieved that functionality using the below code in CRM Ehp1.
    data : str1 type string,
           str2 type string,
           lv_str type string.
    str1 = 'Hello'.
    str2 = 'World'.
    lv_str = |{ str1 }\n{ str2 }|.
    write /: lv_str.
    The output is: Hello#World
    In web ui, it is displaying in two lines like
    Hello
    World
    But, the special character '|' is not supported in CRM 7.0
    Is there anyway for line-break?
    Regards
    DNR Varma

    Hello
    I always use cl_abap_char_utilities=>cr_lf as a line-break symbol .
    Regards
    Joaquin

  • How to detect line break while reading input ?

    Hi all,
    I am reading the user input from standard input.
    I want to detect the line break. So that I can stop reading input and proceed processing the string.
    Actually I am getting the SQL query as input and after that I am executing the same by passing it to a function.
    Pl. do reply me.
       Scanner scanner = new Scanner(System.in);             
            while(scanner.hasNext())
                 temp=scanner.next();
                  sql=sql.concat(" "+temp);
                 if(scanner.next=="\n")
                            break;
           System.out.println(sql);
           sqlTool.executeSQL(sql);
    The above is not working properly.

    But if new line comes, what will be it's value?Empty lines are discarded by the scanner.
    Kaj

  • How to handle non-breaking hyphens on translation to XML

    Hi,
    I have a document that uses non-breaking hyphens in some places and hyphens in others. I think they were trying to stop line wraps from happening in certain cases.
    Anyway, now I need to save these files as XML. I believe I need a 'reader character map is 0x2D = 0x??;' statement in my ReadWrite Rules.
    Problem is I don't know what ESC - h equates to in hex so I can fill in 0x??
    Anyone know the hex value for the non-breaking hyphens?
    Thanks,
    - mike

    Mike,
    I do not know the answer to your question, but I handle nonbreaking spaces and nonbreaking hyphens with elements. That is, I define an empty element for each one in my EDD; the EDD inserts the appropriate character in FrameMaker. When exported to XML, these elements become simply empty elements but with names indicating their purposes. Import back into FrameMaker allows the EDD to insert the appropriate characters. Nothing needs to be done in the read/write rules. Of course, if the XML is to be processed by some other application, then the other application needs to convert these elements into spaces or hyphens for its use.
    This solution may not work in your situation.
    Van

  • How to handle line item for posting a document

    Hello,
    I am using a function module to post a document, so far I have hard coded all the values in the test program. I am passing two internal tables to the function module, one which has header data and the other which has line item data. So far I have written the following code to get the line item details:
    it_bseg-BUKRS = '001'.
    it_bseg-GJAHR = u20182010u2019.
    it_bseg-BUZEI = '001'.
    it_bseg-BSCHL = '31'.
    it_bseg-WRBTR = '900'.
    it_bseg-PSWSl = 'USD'.
    it_bseg-SAKNR = u20180000123456u2019.
    it_bseg-HKONT = u20180000123456u2019.
    it_bseg-LIFNR = u2018001234567u2019.
    append it_bseg to lt_temp_bseg.
    clear it_bseg.
    it_bseg-BUKRS = '001'.
    it_bseg-GJAHR = '2010'.
    it_bseg-BUZEI = '002'.
    it_bseg-BSCHL = '40'.
    it_bseg-WRBTR = '900''.
    it_bseg-PSWSL = 'USD'.
    it_bseg-KOSTL = '1111871234'.
    it_bseg-XKRES = 'X'.
    it_bseg-HKONT = '0000564738'.
    it_bseg-FISTL = '1234556000'.
    it_bseg-GEBER = '0000001'.
    it_bseg-fkber = '0'.
    append it_bseg to lt_temp_bseg.
    clear it_bseg.
    Now I want to get rid of the way I am handling the line item and want to handle it based on what user enters. For example right now only line item is being considered but if user enters two line items then what should be the approach.
    Thank you,
    Rajeev Gupta

    Any Suggestion.

  • How to add line breaks to output fixed width flat file

    0
    I need to create a Flat file without column headers, no comma separated values but each column will have a fixed starting position and a fixed length in the text file. For example, below is the text file to be created with six columns
    Column1  Column2   Column3     Column4  Column5      Column6
    abc          1             New emp      xxxx         xxxx           
    xxx
    Fixed starting position and a fixed lenth values for these columns as are below;
    Column1 : Starting Position -1, Fixed Length -4
    Column2 : Starting Position - 8, Fixed Length - 2
    Column3 : Starting Postion - 11, Fixed Length - 10
    Column4 : Starting Position -1, Fixed Length -5
    Column5 : Starting Position - 10, Fixed Length - 2
    Column6 : Starting Postion - 15, Fixed Length - 5
    The out put file each line have only 20 characters length.First 3 columns comes in first line and 4-6 columns comes in 2nd line.
    OUTPUT FILE:
    1234   89  11121314151617181920
    12345    1011          151617181920

    BOL says that:
    The Fixed width with row delimiters option is not available in the Flat File Connection Manager Editor.
    If necessary, you can emulate this option in the editor. To emulate this option, on the General page of the Flat File Connection Manager
    Editor, for Format, select Ragged right. Then on the Advanced page
    of the editor, add a new dummy column as the final column of data.
    More details steps:
    http://www.coderewind.com/2012/08/ssis-how-to-include-rowdelimiter-with-destination-flat-files/
    Below blog should make things clear:
    SSIS Flat File Export - "Fixed Width" vs "Ragged Right"
    -Vaibhav Chaudhari

Maybe you are looking for