Need help in how to print new line character in unix using java

Hi All,
I use the printstream class to print some line in a text using java.
here is the code:
   FileOutputStream out; // declare a file output object
        PrintStream p; // declare a print stream object
                p.print("\t");
                p.print(date);
                p.print("\t\t");
                p.print(RecCount);
                p.println("\n");when i use this and output of this character in windows is
date RecCount
22-07-2007 23456
when i use the same code in unix it shows the following output:
date RecCount[]22-07-2007
it wont accept the new line character could any one give me an idea to solve this problem.

PrintStream has a println() method. Use that. Or System.getProperty("line.separator").
Because a newline char doesn't necessarily specify a line break. It's system-dependent.

Similar Messages

  • How to print new line in jsp page

    hi
    how to print new line in jsp page
    thanks

    \n - new line character is in java specific not HTML
    specific.Well, if the correct line separator sequence (by far not always \n) would be used, it does add a new line to the HTML output. Too bad that you don't want to see HTML but formatted text. The BR tag is a formatting element for the displayed text, not a line break in HTML. ;)

  • How to insert new line character?

    Hi all,
    I have two lines to print.
    out.println("Available number of columns="+cols);
    out.println("Number of columns must be present=10");My problem is:
    i want both the lines to be printed one below the other. But, it is displayed in one single line.....
    Can anyone please tell me how to insert new line character?
    I tried with \n, '\n' and \r\n but, in vain......
    Thanks for your time.
    Regards,
    Ashvini

    You should never use "\n" directly.
    The line separator character is different on different operating systems.
    And putting quotes around it in your string will make absolutely no difference in the JSP.
    To find out what the line separator is you should use System.getProperty("line.separator");
    The JSPWriter and PrintWriter classes will automatically use this property with a println statement, so a println will always finish with a line separator.
    The issue here was that HTML by default ignores all whitespace.
    The solutions provided
    - use a <br> tag instead of a carriage return
    - use <pre> tags, which tells the browser not to ignore whitespace. That can be troublesome in JSP which generates a lot of extraneous carriage returns into the code.
    Cheers,
    evnafets

  • Problem is occurring in docx format; it is not printing "New Line" character in extracted txt using IFilter (offfiltx.dll) while with doc file IFilter (OffFilt.dll) is working fine.

    Problem: Problem
    is occurring in docx format; it is not printing “New Line” character in extracted txt using IFilter (offfiltx.dll) while with doc file IFilter (OffFilt.dll) is working fine.
    Environment: -
    Operating
    System:
    Windows XP SP2/7
    Language:
    C#
    MS
    Office Version: - MS Office 2007/2010/2013
    Problem
    Description: -
    We
    havedocx
    file with new line character, and we are processing this file in IFilter for extracting text, and it is giving output with concatenation of lines.
    Docx
    file format (Sample.docx)
    Test this music
    Word processing
    Testing docx file
    Output:
    - Test this music Word processing Testing docx file
    Requirement:
    - We
    have requirement to get following text in particular format with New Line from docx because client is using docx format only.
    Test this music
    Word processing
    Testing docx file
    Attempt:
    We have tried a lot after changing IFilter configuration,
    but it is not giving required output. Then we saved same file in doc format (Sample.doc), which is giving required output.
    Because it is application specific problem, kindly
    assist to resolve issue on priority. We are sharing IFilter paths for extracting text for doc and docx.
    Doc Filter Location: - %systemroot%\system32\OffFilt.dll
    Docx Filter Location: - <Drive>:\PROGRA~1\COMMON~1\MICROS~1\Filters\offfiltx.dll
    Code Snippet for setting property of filter
    internal static IFilter LoadAndInitIFilter(string fileName, string extension)
                IFilter filter
    = LoadIFilter(extension);
                if (filter
    == null)
                    return null;
                IPersistFile persistFile
    = (filter as IPersistFile);
                if (persistFile
    != null)
    persistFile.Load(fileName, 0);
                    IFILTER_FLAGS flags;
                    IFILTER_INIT iflags
    =
                                IFILTER_INIT.CANON_HYPHENS
    |
                                IFILTER_INIT.CANON_PARAGRAPHS
    |
                                IFILTER_INIT.CANON_SPACES
    |
                                IFILTER_INIT.APPLY_INDEX_ATTRIBUTES
    |
                                IFILTER_INIT.HARD_LINE_BREAKS
    |
                                IFILTER_INIT.FILTER_OWNED_VALUE_OK;
                    if (filter.Init(iflags,
    0, IntPtr.Zero, out flags)
    ==IFilterReturnCode.S_OK)
                        return filter;
                Marshal.ReleaseComObject(filter);
                return null;
    Kindly
    assist to resolve this issue and also let us know if any input is required.
    For any help, we would be really
    thankful.

    Kindly
    assist to resolve this issue and also let us know if any input is required.
    For any help, we
    would be really thankful.

  • How to remove new line character from query output?

    Hi,
    How to remove new line character from query output?
    have tried select replace(column_name, CHR(10), ' ') from table_name.
    Edited by: GreenHorn on Sep 11, 2008 12:53 AM

    Please consider, that windows uses a sequence of chr13||chr(10) Unix uses only one character chr(10).
    The new line character(s) may be OS-dependent.
    You could consider both with:
    replace(replace(column_name, CHR(13)||CHR(10), ' '),CHR(10),' ')
    Hartmut
    Edited by: hartmutm on 11.09.2008 01:32

  • How to print new line in webdynpro

    Friends,
    I want to print a success message in new line, the below shown is a one singe line and want to split two lines.
    I used this:
    wdComponentAPI.getMessageManager().reportSuccess("Example : this is the test message i would like to print in two lines, some how it is not working please help me how to "+
    "/n/n print this in two new lines.")
    when i execute the above code it is displaying on screen as succsess message as below shown in one line:
    Example : this is the test message i would like to print in two lines, some how it is not working please help me how to print this in two new lines.
    But my requirement expecting  some thing below shown:
    Example : this is the test message i would like to print in two lines, some how it is not
    working please help me how to print this in two new lines.

    really? how?   Ó.o

  • ADF: how to insert new line character in column of VO?

    Hi Everyone,
    Im using Jdev 11G.
    i have a VO with 5 columns displayed on the ADF page.(VO has total 8 columns)
    1 column is the combination of 3 columns. i concatenated the 3 columns and added new line character after each column chr(13).
    VO query is working very fine in Toad. the columnn displays each concatenated column value after a new line character but the same query is not working in ADF.
    The column which is concatenating 3 columns and has to display with new line character is not displaying new line character its just concatenating the 3 values and displaying it on the page.
    wat can be the solution for this in ADF?
    Thank you.

    Setting escape="false" will allow putting html <BR> in the column and it will display ok however if your table allows export to excel the <BR> gets exported and displays as text in your exported file. Also & will export as &amp; To prevent that, use your original text without the escape=false setting and insert LF or CR (10 or 13 character), then add inline style of white-space: pre-line; to column or to style class in your skin. That will cause all line feeds to wrap but will export to excel without mixing html in the export.
    http://www.w3schools.com/cssref/pr_text_white-space.asp
    Edited by: Don Kleppinger on Jan 14, 2013 4:06 PM

  • How to print a document in reverse order using Java Print API ?

    I need to print a document in reverse order using Java Print API (*Reverse Order Printing*)
    Does Java Print API supports reverse order printing ?
    Thnks.,

    deepak_c3 wrote:
    Thanks for the info.,
    where should the page number n-1-i be returned ?
    Which method implementation of Pageable interface should return the page number ?w.r.t. your first question: don't return that number but return page n-1-i when page i is requested; your document will be printed in reverse order. Your class should implement the entire interface and wrap the original Pageable. (for that number n your class can consult the wrapped interface; read the API for the Pageable interface).
    kind regards,
    Jos

  • How to print new line using DBMS_OUTPUT package

    Hi,
    I am trying to print a new line using DBMS_OUTPUT package. but it do not print the new line.
    set serveroutput on size 200000
    set feedback on
    BEGIN
    DBMS_OUTPUT.PUT_LINE('First Line');
    DBMS_OUTPUT.PUT_LINE('');
    DBMS_OUTPUT.PUT_LINE('Second Line');
    END;
    I expect following output ...
    First Line
    Second Line
    but i got following output....
    First Line
    Second Line
    why DBMS_OUTPUT.PUT_LINE( '); is not printing a new line ?

    You can try the following:
    SQL> ED
    Wrote file afiedt.buf
      1  BEGIN
      2  DBMS_OUTPUT.PUT('ONE LINE...');
      3  DBMS_OUTPUT.PUT('SECOND LINE...');
      4  DBMS_OUTPUT.NEW_LINE;
      5  DBMS_OUTPUT.PUT_LINE('THIRD LINE WITH NEW LINE...');
      6  DBMS_OUTPUT.PUT('TEST');
      7  DBMS_OUTPUT.NEW_LINE;
      8  DBMS_OUTPUT.PUT_LINE('FOURTH LINE'||CHR(10)||'EXAMPLE');
      9  DBMS_OUTPUT.PUT_LINE(CHR(10));
    10  DBMS_OUTPUT.PUT_LINE('FIFTH LINE');
    11* END;
    SQL> /
    ONE LINE...SECOND LINE...
    THIRD LINE WITH NEW LINE...
    TEST
    FOURTH LINE
    EXAMPLE
    FIFTH LINE
    PL/SQL procedure successfully completed.Documentation:
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_output.htm#i1000062

  • How to Print new line in Acrobat SDK?

    I was use "\n" in end of string in PDETextAdd, but its doesn't go for new line.Any one help me pls...

    You have to place very single line separately, there is no newline function
    in PDETextAdd.
    Karl Heinz Kremer
    PDF Acrobatics Without a Net
    PDF Software Development, Training and More...
    [email protected]
    http://www.khkonsulting.com

  • How to add new line item to PO using BAPI_PO_CREATE1

    Hi,
    I have a purchase order with 2 line items, now i want to add new line item to the same PO using BAPI_PO_CREATE1.
    Here new line item should be created with reference PR line item.But this PR line item is Dynamic it get generated once the Sales order line item get changed.
    Please let me know how can i pass the PR doc no, PR line item no as reference to create the new PO line item.
    Thanks
    Bhuvana

    Hi,
    I think you need to use BAPI: BAPI_PO_GETDETAIL, then BAPI:BAPI_PO_CHANGE.
    BAPI_PO_CREATE1 equals ME21N, but adding new line item needs to be done in ME22N.
    Cheers,

  • How to add new line item to SO using BAPI_SALESORDER_CREATEFROMDAT2

    Hi,
    I have sales order A with 1 line item, now i want to add new line item with material x and quantity y to the existing sales order A
    using BAPI_SALESORDER_CREATEFROMDAT2.
    Line item no for new line item should be generated by SAP internally.Please let me know the mandatory parameters to be passed to the BAPI to fulfill the requirement.
    DATA: order_header TYPE bapisdhd1,
               order_inx TYPE bapisdhd1x,
               partners TYPE TABLE OF bapiparnr,
               wa_partners TYPE bapiparnr.
    CLEAR: salesdocument,order_header_inx,wa_in, wa_inx.
    REFRESH: item_in, item_inx.
      salesdocument = wa_vbup-vbeln.
      order_header_inx-updateflag = 'X'.
      wa_in-itm_number = ' '.
      wa_in-material = p_nmatnr.
      wa_in-target_qty = gv_menge - gv_wemng.
      APPEND wa_in TO item_in.
      wa_inx-itm_number = ' '.
      wa_inx-updateflag = 'U'.
      wa_inx-target_qty = 'X'.
      APPEND wa_inx TO item_inx.
          CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
          EXPORTING
           salesdocumentin               = salesdocument
           order_header_in               = order_header
           order_header_inx              = order_inx
          IMPORTING
           salesdocument                 = salesdocument
          TABLES
           return                              = return
           order_items_in                = item_in
           order_items_inx               = item_inx
           order_partners                = partners.
    Thanks
    Bhuvana

    Hello,
    You can use FM: BAPI_SALESORDER_CHANGE with update indicator I (insert)
      call function 'BAPI_SALESORDER_CHANGE'
        exporting
          salesdocument    = l_vbeln
          order_header_inx = l_wa_order_header_inx
          simulation       = l_simulation
        tables
          return           = l_i_return
          order_item_in    = l_i_order_item
          order_item_inx   = l_i_order_item_inx
          partners         = l_i_partners
          schedule_lines   = l_i_schedule_lines
          schedule_linesx  = l_i_schedule_linesx
          extensionin      = l_i_extensionin.
    Thanks
    Subhankar

  • Need help on how a user can control a video clip using their mouse

    I need help. I've got a video clip of a rotating 3D
    object(left to right) and i would like the user to be able to
    control the rotation of the object using their mouse. I've looked
    everywhere and i'm at a lost. Can anyone help me
    Here is a link to what i'm trying to achieve:
    http://www.sun.com/servers/blades/6000/gallery/index.xml?p=1&s=2
    I know they use Java but i'm sure this can be done in Flash.
    Thanks
    Ray

    Just use the plain linear fit!
    (If you are discussing something you found in the forum, you should always include a link so we can see what you area talking about. What you probably found was a workaround that forces an intercept of zero for a special scenario. If you want to use general linear fit anyway, your matrix simply also needs a constant term)
    If you still have problems, show us your code and some data.
    LabVIEW Champion . Do more with less code and in less time .

  • How to write new line character to a file from textarea

    Hi ,
    I want to save the contents of textarea in a file.The textarea may contain new line characters,
    I am getting the contents from the textarea using getText() method but after writing the contents to the file
    it stores the entire text in a single line.But I want the text as it apperars in the textarea.
    Please provide me a good solution.
    -mani

    maybe this code samples are useful to your problem
    File datatext = new File(fileName);
    try {BufferedWriter writer =new BufferedWriter(new OutputStreamWriter(new FileOutputStream(datatext)));
    writer.write(.......);
    writer.newLine();
    writer.close();                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to replace a line ina text file using java?

    Hi ALL,
    Does anybody know how to replace a line in a text file uisng java.

    use this thing:
    http://doesthatevencompile.com/current-projects/code-sniplets/ASCIIFile.htm
    open the file,
    read its contents, replace the text you need in the contents, set the contents back into the file.
    it takes care of the IO for you.

Maybe you are looking for

  • PLSQL processing of a dynamic sql report

    Hi there, I have a problem processing a dynamic sql report, specifically in referencing the PL/SQL column headings I have. Basically I have a report that generates one row for each project a person belongs to, and then using htmldb_item.text creates

  • Error in running web logic/forms locally: wrong signature

    Hi, We are trying to configure oracle forms/reports 11g on each developer machine. In running form from either forms builder or IE I'm getting an error: Forms Session ID is formsapp.2 The proxy host is null, and the proxy port is 0. Native HTTP imple

  • Blackberry Curve 9220 Won't Switch stuck On only red light blinking RED LIGHT! HELP!

    my blackberry is stuck on red light blinking oleas help me no problem if all the data is lost i dont care i want my phone back it hase been 3 -4 weeks . light is blinking until the battery goes down and it wont charge also i have to get the battery c

  • Scan Rate - Sample Rate confusion with the E-Series

    I have been reading a lot of post on the messaging board concerning the scan rate and the sample rate but I still dont get it. I am using an E series and am aware that this card does not have a simultaneous sampling of each channel I want a time stam

  • Bt Wifi on more than 1 device

    Hi Can the BT Wifi/Fon app be used on more than 1 device at the same time with the same log in details? I cannot see anything in the terms and conditions where it cannot be used. Solved! Go to Solution.