Line break when spooling file

Say if you create a spool file and your going to execute a
select statement to write data to this file.
Is it possible to get a select statement to automatically put a
line break and go to the next line in the file it is spooling
to??
Say for example:
Select 'DROP TABLE'||table_name||';'||
'CREATE TABLE'||table_name||';'
from user_tables;
I apologize if this is confusing. Thanks.
Troy

I tried what you suggested for a unix system and I still have a
problem. Sometimes there is a line break in between my insert
and select statement when i try to run to the spooled script
afterwards.
For example:
select 'INSERT INTO temp_table (name, height, numrows) '||chr(10)
||'SELECT name, height, 0 from index_stats;' from dba_indexes
where owner = 'USER1' and index_name NOT LIKE 'SYS%';
It will be like:
INSERT INTO temp_table (name, height, numrows)
SELECT name, height, 0 from index_stats;
This only returns the record but doesn't insert it in the table.
Any other suggestions on how to fix this would be greatly
appreciated?? Thanks.

Similar Messages

  • Prevent Occurence of list header and page breaks in spool file of ALV Grid

    Prevent Occurence of list header and page breaks in spool file of ALV Grid  Display.
    When we run the ALV in background and create spool request then:
    Spool file output is coming like this.
    Column1 Column2 Column3 Column4
    data        data        data       data
    data        data        data       data
    data        data        data       data
    Column1 Column2 Column3 Column4
    data        data        data       data
    data        data        data       data
    data        data        data       data
    But the required is like this
    Column1 Column2 Column3 Column4
    data        data        data       data
    data        data        data       data
    data        data        data       data
    data        data        data       data
    data        data        data       data
    data        data        data       data
    Please suggest a posible answer

    Hello all,
    if you have not yet solved this on your own, here is my solution: use a format type that has 60000 lines per page for your spool output device.
    It all depends on the format type that was used for creating the spool output.
    By default (in our system), we have 65 lines per page. And after each page the column headings of the ALV will appear.
    What i did:
    create a new format type via transaction SPAD->full administration->device types->format types (copy an existing one)
    change"Number of Rows" to 60000 or something applicable
    edit the device type of your output device (e.g. LOCL) to contain the newly created format type (via SPAD; Button "Formats" in device type maintenance).
    That's it! Be sure to use this format type for your output device in the "Background Print Parameters" window (-> Button "Properties").
    Regards
    Daniel Klein
    All other parameters you discussed before didn't do it. All ALV-Settings will be overwritten by the output device settings and its print properties.

  • How to insert Page Break in SPOOL file

    How to insert Page Break in SPOOL file.

    How to insert Page Break in SPOOL file.
    SET NEWP[AGE] {1|n|NONE}
    SET NEWPAGE is not supported in iSQL*Plus
    Sets the number of blank lines to be printed from the top of each page to the top
    title. A value of zero places a formfeed at the beginning of each page (including
    the first page) and clears the screen on most terminals. If you set NEWPAGE to
    NONE, SQL*Plus does not print a blank line or formfeed between the report pages.
    http://www.lc.leidenuniv.nl/awcourse/oracle/server.920/a90842/ch13.htm
    SQL> SET PAGESIZE 5
    SQL> SET NEWPAGE 0 --a form feed between your pages
    SQL> SPOOL C:\output.doc
    SQL> SELECT * FROM emp;
         EMPNO ENAME      JOB             MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        800          0         20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
         EMPNO ENAME      JOB             MGR HIREDATE         SAL       COMM     DEPTNO
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850          0         30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450          0         10
         EMPNO ENAME      JOB             MGR HIREDATE         SAL       COMM     DEPTNO
          7788 SCOTT      ANALYST         7566 09-DEC-82       3000          0         20
          7839 KING       PRESIDENT            17-NOV-81       5000          0         10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
         EMPNO ENAME      JOB             MGR HIREDATE         SAL       COMM     DEPTNO
          7876 ADAMS      CLERK           7788 12-JAN-83       1100          0         20
          7900 JAMES      CLERK           7698 03-DEC-81        950          0         30
          7902 FORD       ANALYST         7566 03-DEC-81       3000          0         20
         EMPNO ENAME      JOB             MGR HIREDATE         SAL       COMM     DEPTNO
          7934 MILLER     CLERK           7782 23-JAN-82       1300          0         10
    13 rows selected.
    SQL> SPOOL OFFKhurram

  • HT4641 after modifying a document in Pages I found that there are horizontal lines across every line break when opened and saved it in DropBox.  Does anyone know why?

    after modifying a document in Pages ON MY IPAD AIR I found that there are horizontal lines across every line break when opened and saved it in DropBox.  Does anyone know why?

    Thanks a lot for your swift response. And sorry if it was a bit too hectic to go through my detailed query (which I did because it was misunderstood when I asked previously). As I've mentioned above, I was informed that updating to 5.0.1 would '''require''' me to '''delete''' the current version and then install the new one. And doing so will involve losing all my bookmarks. I guess I should have been more specific and detailed there. By losing, I didn't mean losing them forever. I'm aware that they're secured in some place and deleting and installing the software doesn't harm its existence. What I meant that if I install the new version, I'd have to delete the old one. And after installing the new version, I'd have to transfer them (bookmarks) back from wherever they are. Get it? When it updated from 3.6.9 to 3.6.13, and from 3.6.13 to 3.6.18, I didn't need to follow that process. They were already present on their own.
    BTW, I'm having no problems with 3.6.18 but after learning about the existence of version 5.0.1, I'm a bit too eager to lay my hands over it.
    Thanks for your help; hope this wasn't extremely long.

  • Blank line in the spool file

    Good day,
    I was trying to retrive data from the table and save the results in the spool file, but I find blank lines in the spool file. What can be the couses of that? I am using oracle 9i.
    regards
    Talifhani

    SET SHOWMODE off
    SET FEEDBACK OFF
    SET VERIFY off
    SET RECSEP off
    SET TRIMSPOOL on
    SET LINESIZE 20000
    SET HEADING OFF
    SET PAGESIZE 0
    SET PAGES 0
    ==>Select the spool file
    ==>Run you query
    ==>Spool off.
    Now check the spool file.
    Good luck!!!
    Bhagat

  • Line break in txt file

    Can someone help me?
    I just wanna make a line break in a txt file...
    I tried it this way
    FileWriter fw = new FileWriter("W:\\write.txt");
    fw.write(string1 + "\n" + string2);
    fw.close();
    I don't know why it doesn't work.
    in the file it apears just a black block, but if i copy it in this text area, theres automaticly a line break
    thx for your support
    Guardian

    Everything has been said, but I thought I'll just make it more clearly :-)
    The thing is:
    Unix use a line break; <or was it vice versa>
    Afterwards someone decided text had to be devided in linebreaks and paragraph;
    That's why you have <p> and <br> in html
    Now line break just means, I'm on the end of a line and i must break but i don't want to
    so please if you can, hold it on the same line when displaying.
    So to keep multiple platform oparability it's a good thing to use both:
    newline character + carriage return = break to other line

  • Line Break for XML File

    All,
    I am able to generate xml file from an internal table. The problem is, if I open the file in IE everything looks good. When I open it in notepad or notepad++, everything is in one line. Can you tell me how to generate a line break after each tags.
    Please find the following code used by me for reference.
    LOOP AT lt_ohd INTO ls_ohd.
        ls_temp_ohd = ls_ohd.
        AT FIRST.
          l_ixml = cl_ixml=>create( ).
          l_document = l_ixml->create_document( ).
          l_element_ohd  = l_document->create_simple_element(
                      name = 'OHD'
                      parent = l_document ).
        ENDAT.
        AT NEW cc.
          CLEAR : lv_inhaltskom, lv_text.
          lv_inhaltskom = ls_temp_ohd-cc.
          CALL FUNCTION 'ISM_SELECT_TEXT_JJTIKO'
            EXPORTING
              pv_inhaltskom = lv_inhaltskom
            CHANGING
              pv_langtext   = lv_text.
          TRANSLATE lv_text TO UPPER CASE.
          l_value = lv_text.
          l_element_county  = l_document->create_simple_element(
                      name   = 'city_county'
                      value  = l_value
                      parent = l_element_ohd  ).
        ENDAT.
        AT NEW order.
          l_element_neighborhood  = l_document->create_simple_element(
                      name    = 'entry'
                      parent  = l_element_county  ).
        ENDAT.
        l_value = ls_temp_ohd-neighborhood.
        l_element_address  = l_document->create_simple_element(
                    name   = 'neighborhood'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-address_detail.
        l_element_address  = l_document->create_simple_element(
                    name   = 'address_detail'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-order.
        l_element_address  = l_document->create_simple_element(
                    name   = 'order'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-item.
        l_element_address  = l_document->create_simple_element(
                    name   = 'item'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-cc.
        l_element_address  = l_document->create_simple_element(
                    name   = 'cc'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-address.
        l_element_address  = l_document->create_simple_element(
                    name   = 'address'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-price.
        l_element_address  = l_document->create_simple_element(
                    name   = 'price'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-bed.
        l_element_address  = l_document->create_simple_element(
                    name   = 'bed'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-bath.
        l_element_address  = l_document->create_simple_element(
                    name   = 'bath'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-opentime.
        l_element_address  = l_document->create_simple_element(
                    name   = 'opentime'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-state.
        l_element_address  = l_document->create_simple_element(
                    name   = 'state'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-zip.
        l_element_address  = l_document->create_simple_element(
                    name   = 'zip'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_streamfactory = l_ixml->create_stream_factory( ).
        l_ostream = l_streamfactory->create_ostream_itable( table = lt_xml_table ).
        l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                              document = l_document ).
        l_rc = l_renderer->render( ).
        l_xml_size = l_ostream->get_num_written_raw( ).
      ENDLOOP.
    Regards,
    Salil
    Edited by: salil vaidya on Jan 18, 2011 2:34 PM

    Thanks.
    But now, I have a syntax error.
    BEGIN OF xml_line,
              data(256) TYPE x
    END OF xml_line.
    DATA: lt_xml_table      TYPE TABLE OF xml_line,
          ls_xml_table      TYPE xml_line.
    LOOP AT lt_xml_table INTO ls_xml_table.
        CONCATENATE ls_string cl_abap_char_utilities=>cr_lf INTO ls_string.
        MODIFY lt_xml_table FROM ls_xml_table INDEX sy-tabix.
        CLEAR : ls_xml_table, ls_string.
      ENDLOOP.

  • Error in line break in a file adapter

    Hi,
    I have a problem with a file receiver adapter. In File Content Conversion I put 'nl' in the endSeparator parameter but when I see the "output.txt" file generated all data are put in same line separated by rectangular characters.
    I think this rectangular characters are the line breaks characters. My problem is that the target application don't recognized those rectangular characters like line breaks.
    Also i tried to put in endSeparator the ASCII character '0x0A' but the line break neither work.
    In file Encoding parameter I tried with every charset encodings like: US-ASCII, ISO-8859-1, Windows-1252... but the line break don't work.
    Could be important the operating system over XI is running? SAP and XI is running over a AS400 system.
    Thanks in advance for any reply.

    Hi Prashanth,
    Thanks for reply.
    I Tried with UTF-8 and it doesn´t work.
    I tried with almost all known charsets but none of them work. The line break doesn't appears.
    I want write:
    line1
    line2
    line2
    If i open the notepad in the file appears:
    line1&#8301;line2&#8301;line3&#8301;...
    The target application doesn't recognized the &#8301; character like a line break.
    but if i copy the text of file and i put it in a doc file or in this forum, for example, the line break appears.

  • Dreamweaver CS6 - Losing Line Breaks of PHP Files

    Hi all,
    If this has been asked and answered, I apologize. I have scoured the forums and Google for this, but coming up empty.
    Yesterday, upgraded from DW CS5 to 6. First site working on, opened up both .htm and .php files. Made simple changes, and uploaded to the server (both within, and outside of DW).
    All the PHP files are immediately broken. When viewing the page code via my FTP program, all the formatting has been removed (basically line breaks). Obvioulsy, this would see like a "file type" issue. I have tried what seems to be every combination of settings in the Pref>New Document> config box and none make a difference.
    I also know this could be depended on my server type (Linux). The HTML pages don't seem to mind that all the line breaks are gone from the code, but PHP pages do.
    Attaching what the code looks in DW, but then looks like after I save it and view it via my FTP.
    Any help would be greatly appreciated!

    Hi Jon - I'm back! So - now that I have the Code Format toggled to Linux, it works perfectly when I put up my PHP files.
    However, I'm learning that when I put up .html files - they go up completely empty. Everything is stripped out - when I view it within my FTP software the pages are entirely blank.
    I have many sites that have files of each type, and this was never an issue with Dreamweaver 5.
    Thoughts?

  • 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

  • How can you enter a line-break when using a Bluetooth Keyboard or onscreen Keyboard?

    In Pages &amp; Keynote the only way to force a line break I have found is to put your finger at the end of a line until the select/insert option appears and then selecting insert, then select line break.
    This is frustratingly slow when typing a presentation or document so I bought a Logitech Ultrathin Bluetooth keyboard assuming that would have the Shift+Enter shortcut to make a line break. It doesn't, nor can I find any key combination that does, it's always a new paragraph, or nothing happens.
    I have an Ipad3,  IOS 6.1.3. I've spoken to Logitech support - they said talk to Apple iOS support, I spoke with a chap at IOS support who didn't know what a line break was, didn't know shift+enter on a PC made a line break so didn't understand my question and ended the call.
    Anyone know how to create the shortcut as an alternative to the onscreen slow way?

    Yes
    http://support.apple.com/kb/HT5633
    You can also download the remote app if you have an IOS device

  • Insert line break into .txt file

    Alright, so I am writing out to a simple .txt file, and I
    need to force a line break in it. My immediate thought is to use
    "\n" as that is a line break. So, I write it out to the text file,
    and instead of a line break, I see the "complex character" symbol
    (you know, that square that shows up with unknown characters). I
    have tried the various ASCII values to no avail, tried \r, even
    tried copy-pasting a line break in from notepad. Nothing seems to
    be working for me. How do I do this?
    _logFile = "\n";
    stream = new FileStream();
    stream.open(file,FileMode.WRITE);
    stream.writeUTFBytes(_logFile);
    stream.close();

    in windows use "\r\n"
    i.e. _logFile = "\r\n";

  • SQL Plus Error - "Can't open file" when spooling

    Hi:
    I have a user who is either able or unable to spool when running a script depending on what Oracle user she logs in as. She's always logging in as the same Linux user but connecting to Oracle as different Oracle users via SQL Plus. When spool files are created they are created with that user's account and group settings, so the OS account seems to be fine.
    I'm having a problem with the idea that there is an Oracle role or something that controls this. Spool isn't UTL_FILE. Is this a SQL Plus application setting or something?
    We're using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    Thanks

    Well, I'm working off an email so maybe they cut and pasted and maybe they didn't. They say the error is
    spool error: "Cannot create spool file"
    I'll have to recreate their situation and see what it really says. But either way, my confusion is how this same OS user can log in as a different Oracle user and spool away. Perhaps the comment above is correct. It worked the first time and they tried to run under the other account without removing the current file. I tend not to think so because these users have been running similar reports for years and they usually have to remove the old output file before re-running.

  • Printing with line breaks

    Hi,
    I am using the following code to print some text from a text file.
    import java.awt.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import java.awt.print.*;
    import java.io.BufferedReader;
    import java.io.DataInputStream;
    import java.io.FileInputStream;
    import java.io.InputStreamReader;
    import java.text.*;
    public class Print implements Printable {
    private static final String mText = "";
    private static AttributedString mStyledText = new AttributedString(mText);
        static public void main() {
            String toPrint = "";
            try {
                FileInputStream fstream = new FileInputStream("/Library/iDemo/print.txt");
                DataInputStream in = new DataInputStream(fstream);
                BufferedReader br = new BufferedReader(new InputStreamReader(in));
                String strLine;
                while ((strLine = br.readLine()) != null) {
                    toPrint = toPrint + System.getProperty("line.separator") + strLine;
                in.close();
            } catch (Exception e)
                System.err.println("Error: " + e.getMessage());
            mStyledText = new AttributedString(toPrint);
            PrinterJob printerJob = PrinterJob.getPrinterJob();
    Book book = new Book();
    book.append(new Print(), new PageFormat());
    printerJob.setPageable(book);
    boolean doPrint = printerJob.printDialog();
    if (doPrint) {
    try {
    printerJob.print();
    } catch (PrinterException exception) {
    System.err.println("Printing error: " + exception);
    public int print(Graphics g, PageFormat format, int pageIndex)
    Graphics2D g2d = (Graphics2D) g;
    g2d.translate(format.getImageableX(), format.getImageableY());
    g2d.setPaint(Color.black);
            Point2D.Float pen = new Point2D.Float();
            AttributedCharacterIterator charIterator = mStyledText.getIterator();
            LineBreakMeasurer measurer = new LineBreakMeasurer(charIterator, g2d.getFontRenderContext());
            float wrappingWidth = (float) format.getImageableWidth();
            while (measurer.getPosition() < charIterator.getEndIndex())
                TextLayout layout = measurer.nextLayout(wrappingWidth);
                pen.y += layout.getAscent();
                float dx = layout.isLeftToRight() ? 0 : (wrappingWidth - layout.getAdvance());
                layout.draw(g2d, pen.x + dx, pen.y);
                pen.y += layout.getDescent() + layout.getLeading();
            return Printable.PAGE_EXISTS;
    }The problem I am having is that it removes the line breaks when printing. I have checked the file I am reading from and that has the line breaks. How can I get it to include the line breaks?
    Thanks

    The problem is that once it prints all this the line break is gone.
    Up until the following code the line breaks are fine. However, the printed document I'm getting has no line breaks at all.
    mStyledText = new AttributedString(toPrint);
            PrinterJob printerJob = PrinterJob.getPrinterJob();
    Book book = new Book();
    book.append(new Print(), new PageFormat());
    printerJob.setPageable(book);
    boolean doPrint = printerJob.printDialog();
    if (doPrint) {
    try {
    printerJob.print();
    } catch (PrinterException exception) {
    System.err.println("Printing error: " + exception);
    public int print(Graphics g, PageFormat format, int pageIndex)
    Graphics2D g2d = (Graphics2D) g;
    g2d.translate(format.getImageableX(), format.getImageableY());
    g2d.setPaint(Color.black);
            Point2D.Float pen = new Point2D.Float();
            AttributedCharacterIterator charIterator = mStyledText.getIterator();
            LineBreakMeasurer measurer = new LineBreakMeasurer(charIterator, g2d.getFontRenderContext());
            float wrappingWidth = (float) format.getImageableWidth();
            while (measurer.getPosition() < charIterator.getEndIndex())
                TextLayout layout = measurer.nextLayout(wrappingWidth);
                pen.y += layout.getAscent();
                float dx = layout.isLeftToRight() ? 0 : (wrappingWidth - layout.getAdvance());
                layout.draw(g2d, pen.x + dx, pen.y);
                pen.y += layout.getDescent() + layout.getLeading();
            return Printable.PAGE_EXISTS;
    }

  • SSL and line break "\n"

    Hey,
    I have a SSL client/server pair that pass messages between each other. Basically I'm having a problem where any sent message containing a line break are split based on this line break.
    So if I sent "cheese \n monster \n", the server would recieve it as two different commands ("cheese" and "monster), instead of a single string.
    Is this unavoidable? I could replace the line breaks with some other identifier and replace them with line breaks when the message is recieved. But I'd rather try and find a way around this first.
    Thanks in advance :)

    SSL doesn't do anything with line-breaks. Once the SSL handshake has taken place, it's just a Socket. I've used JSSE to transfer all kinds of data, and it doesn't do anything to the data being sent. If your code's behavior has changed after switching to SSLSocket, then I'm quite certain you've changed more than just the socket-type along the way.
    What I'm saying is, if you're using readLine() to read from the Socket stream, then it's going to give you each line in turn - that's what readLine() does, whether your end datasource is a SocketInputStream or a File. If your data has linebreaks in it, then you have two choices - don't use readLine() the way you are, or encapsulate your data as a message. Say, have a "MESSAGE START" at the beginning, and a protocol that says "do readLine() until you see 'MESSAGE END' ", for example.
    Grant
    (Well, there is a third option - have a protocol that breaks in the face of line-ends in the data. But I don't think you want that one...)

Maybe you are looking for