Line Break in Java for writing to a file

Hi
I am writing some data from excel sheet to a text file. I am using POI for reading the data from excel sheets.
Whenever i encounter a value in the cell i want to add it to the text file.. this works fine
But when its a new row(in excel sheet), i want it to be printed on a new line in the text file.
Does anyone have a suggestion how can i move the cursor to the next line?
Also i am taking the excel file from user and have to convert it to a tab limited file after some checking.
As anyone done this before & would like to share some experience or have some suggestions?
Thanx

Hi paul
Thanx for your reply. ('\n') works for the next line and I am using ('\t') for tabs between columns
I had one more question.
Can anyone tell me how i can write int values to the file?
My excel sheet has String, numeric, String, String, String data
From POI HSSF i get the string values as String, and i am casting the numeric values to int (since POI hssf returns double)
When addind data to the file, the string values are taken fine.. but not the numeric values.. a '?' is put instead of the int value (which is 4 -6 digit long)
DO i have to change to char buffer or something?
Please let me know

Similar Messages

  • Line break up during email writing

    How can I do line break up during email writing.I couldn't find any enter option.with touch I can do only once.but I need two or three line space.

    There is no word processing type formatting in the mail app. The only formatting in the mail app is for bold, italics and underlined text.
    if you want additional spaces between lines, you just have to keep tapping the return key.

  • Line breaks in java

    Hi, I'm a little new to Java. I am trying to make a line break that is not in a textbox. So far, to make something similar to a line break, I played with the size of the applet on the HTML file. However, it's not working for one of my applets because it must be in several lines.
    I know that you can use /n or /r/n for line breaks in a TextArea, but I need to use line breaks to separate Buttons and several TextFields.
    In an earlier forum there was something like this:
    System.getProperty("line.separator");
    I don't really know how to add the line separator to my code. I pasted that just inside
    public class ClassName extends java.applet.Applet
    implements ActionListener
    right before
    public void init( )
    I tried putting "line.separator" in a string, but it did not work
    I also tried the following:
    add(/n);
    add(/r/n);
    add(line.separator);
    but none of them worked.
    If someone could help me, I would very much appreciate it. Thanks!

    I don't know why I didn't think of that, but there's an error when I compile it.
    SquareRoot.java:21: cannot find symbol
    symbol : method add(java.lang.String)
    location: class SquareRoot
    add(System.getProperty("line.separator"));
    ^
    And the same thing happens when I try it with \n
    SquareRoot.java:21: cannot find symbol
    symbol : method add(java.lang.String)
    location: class SquareRoot
    add("\n");
    ^
    Here's the code:
    public class SquareRoot extends java.applet.Applet
         implements ActionListener
         TextField m1, m2;
         Button b;
         double i1, i2, i3, i4;
         public void init( )
              m1 = new TextField(20);
              m2 = new TextField(20);
              b = new Button("Calculate");
              add(m1);
              add("\n");  //I'm trying to add a line break here
              add(b);
              add(m2);
              b.addActionListener(this);
         }Thanks!

  • How can I create a line break in pages for iPad?

    On the Mac you can hold the shift key while pressing the return key to creat a line break. Only pressing the return key will creat a new paragraph of course.
    On the iPad you only can creat paragraphs. Pressing the shif key does not change that.
    Does anybody know how to force a linebrek on the pages app for iPad?

    Tap and hold where you wish to insert the line break. Select Insert from the pop up menu, then Line break.
    this might be helpful for future reference: http://help.apple.com/pages/ipad/1.7/

  • Java Embedding for writing string into file

    Hi ,
    According to my requirement I need to create a file and write string data into file.
    This string data I am getting as a output of the partner link. Their is 5 string variable which I need to write in file .
    I want to use java Embedding activity .
    So plz provide me any solution or any link.

    Hi,
    Why would you want to do this with java embeding? Why not just use the assign activity to create/concatenate the string and then write it to a file with the file adapter?
    Andre

  • Help for writing to excel file from Java Program

    Hi,
    I am new to Java and Java API. I need to write to some specific cells of an excel file from a Java Program. Please anyone help me or give some directions.
    Thanks,
    Reet

    Hi,
    I saw an example while searching in google about importing jxl.*. Could you direct me how I can import this package as java does not have it. I heard that jxl is much easier that POI although I am not new to both of them.
    Thanks,
    Priya

  • Error creating Webservice Client in JAVA for ABAP Webservice(WSDL file)

    Hi all,
    I have created a webservice from a funtion module in the backend.
    Using soamanger I downloaded the wsdl file using "Open WSDL document for selected binding" link.
    I tested this web service in backend and it is working fine.
    Now I am trying to generate JAVA cilent for this webservice using Eclipse and Axis,but getting the following error
    IWAB0399E Error in generating Java from WSDL:  WSDLException (at /wsdl:definitions/wsdl:portType/wsp:Policy):
    faultCode=INVALID_WSDL: Encountered unexpected element '{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy'.:
        WSDLException (at /wsdl:definitions/wsdl:portType/wsp:Policy): faultCode=INVALID_WSDL: Encountered unexpected element
    '{http://schemas.xmlsoap.org/ws/2004/09/policy}Policy'.:
        at com.ibm.wsdl.util.xml.DOMUtils.throwWSDLException(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parsePortType(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
        at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
        at java.lang.Thread.run(Unknown Source)
    Please let me know,wat needs to be done for this error to get resolved
    Thanks
    Santhosh

    Hi,
    I am also getting the same error while generating the client class from IBM Rational Application Developer IDE.
    Here is the error I get.
    WSDLException (at /wsdl:definitions/wsdl:portType/wsp:Policy): faultCode=INVALID_WSDL: Encountered unexpected element 'Policy'.:
         [java] at com.ibm.wsdl.util.xml.DOMUtils.throwWSDLException(Unknown Source)
         [java] at com.ibm.wsdl.xml.WSDLReaderImpl.parsePortType(Unknown Source)
         [java] at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
         [java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
         [java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
         [java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
         [java] at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)
         [java] at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
         [java] at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
         [java] at java.lang.Thread.run(Thread.java:571)
    Did you find out the cause of this issue?
    Thanks & Regards,
    Vijay

  • Raw update breaks camera support for Fuji X10 raw file.

    Just a headsup, do not update!

    Only Apple can asnwer the "Why?" questions, I'm afriad.
    Aperture menu -> Provide Aperture Feedback and let them know you want it.

  • Score, Line Breaks, Preparing Parts (oh... Rohan?!?)

    Couple of questions about preparing my parts from the score for a small string ensemble...
    Got my conductor's score looking all spiffy. Now I need to extract my individual parts. I've done this a million times in the past and I always run into the same problems, so I thought it time to get some sagely advice.
    1. Is there any way to "lock" line breaks so that when I create individual parts from my score that the line breaks I created for the conductor's score remain intact in my parts?
    Seems that when I double-click on a particular part's staff to see just that part, my line breaks have been disregarded completely.
    2. On a related note, taking Rohan's advice from another thread, I created a duplicate score style for each part that I was going to extract (never done that before). But when I selected the first duplicate score style (for preparing my violin 1 part), the score layout changed. I'm stumped...
    This pic shows the first page of the conductor's score using my original Instrument Set:
    The second pic shows what happened when I selected my duplicate Instrument Set. You can see how messed up it got...

    iS,
    i didn't mean make a duplicate of the full score , i meant make an instrument set of the individual instrument. that means there is only the one instrument in the entire set. you can then format it exactly as you need it to look and print pdf. how line breaks correspond to others is a bit of a mystery, but in general it looks right when i go into each part/instrument set even though i have no faith that it will. but at least each part will have its own individual size and appears to retain its line breaks.
    the workflow i have found really reliable is:
    - create the instrument sets for your parts and insert any extra markings working your way through the score and pdf-ing as you go.
    - you may discover errors or omissions or something that you need to return to a previous part to correct, so you can then re-pdf.
    - only once you have all the parts pdf-ed, pdf the score having first deleted all multi bar rests by selecting one in an event editor and then hitting 'select similar'. this is neceassry as multi-bar rests cause display problems. hopefully with LP8 we won't have to do that.
    you DON'T save that version. you revert to save after pdf-ing the conductors score. i know it's silly, but the work around at the end only takes a moment. but going about it this way will virtually guarantee everything will turn out as it should.

  • Insert Line Break with Syndicator

    Hello,
    I have a quite "simple" question: Is it possible to insert a linebreak after a record set using the MDM Syndicator? By default there are some values offered, like ',' or ';' and so on to seperate values, and you can specify seperators by your own. But how to specify a line break?
    Thanks for your replies!
    Andreas

    Andreas,
    As far as I know, there is no support for specifying the line break. The records automatically appear in separate rows (If you are using Flat file as Destination).
    If you still need to specify your own custom character at the end of each line, create a "Custom Item" and enter the required character in the "Formula" for Custom Item and map this custom Item to a newly created destination field (at the end of all destination items).
    Hope this helps,
    Regards,
    Rajani Kumar

  • Customize Line Items Details Loading for Multiload TEXT-Based

    Hi all,
    has anybody customized HFM adapter to enable line item details loading for Text-based multiload files?
    Is it possible?
    Thanks

    But then we wouldn't have one text multiload file but several text files that will be converted into several .dat files to be loaded into HFM.
    Our current problem is that we have a multiload text file (we can convert from the Multiload Excel) but this file contains line item details. We want to keep the performance of loading only one .Dat file, but also load line item details.
    What about if the user split the multiload files into two:
    * Excel Multiload just with Line Item accounts (there are not so much)
    * Text Multiload for standard accounts
    This would be a nice solution as well? If they are happy....
    Thanks

  • Ttunes 12.0.1 line breaks

    Hi all,
      It is very important that I be able to insert line breaks in the comments section of a file in iTunes. To be specific I mean when you right click a file in iTunes and click on "Get Info" it brings up a box where you can enter id3 data about a song (Title, Artist, Album, Track Number, Comments, etc). Well, in the "Comments" section of that "Get Info" box, I need to add line breaks. This was acheivable in all other versions of iTunes by using "ctrl + Enter" (PC) or "alt+Shift+Enter" (Mac). However on the new version of iTunes 12.0.1 these methods of entering a line break do not work. Does anyone have a solution to this? Any help would be greatly appreciated.
    Thanks,

    Just discovered that in Windows you can hold down shift while using right-click > Get Info (or File > Get Info) to get the old style dialog box. (It's alt on a Mac.)
    Again clunky but probably easier than my script.
    tt2

  • Java Update 5 (1.0) breaks Java for Volano based chats

    I installed the Java Update 5 (1.0) for Leopard on my Intel based Mac mini and then was unable to enter Volano (Java applet) based chat rooms. I was forced to reinstall my system to revert to my prior version of System 10.5.8 in oder to be able to continue use the Java based Volano chats. The update that will NOT work states: "This release updates Java SE 6 to to version 1.6.0_1.5, J2SE 5.0 to version 1.5.0_20, and J2SE 1.4.2 to 1.4.2_22."
    According to Volano developers -
    Note that Apple calls Java 5 (version 1.5) "J2SE 5.0", while it calls Java 6 (version 1.6) "Java SE 6". I think I finally have the following chart correct:
    J2SE 5.0 = Java 5 (version 1.5)
    - Available as 32-bit and 64-bit packages in Leopard
    - Removed in Snow Leopard
    Java SE 6 = Java 6 (version 1.6)
    - Available only as 64-bit packages in Leopard
    - Available as 32-bit & 64-bit packages in Snow Leopard
    In Leopard, the 32-bit Safari can run Java applets only with the 32-bit
    J2SE 5.0 support. To run applets using Java SE 6, you need to bypass
    Safari using the "appletviewer" Terminal command in Leopard, or upgrade
    to Snow Leopard where Safari can run Java SE 6.
    Volano says the possible work arounds for Leopard users (10.5.8( are:
    According to what I've read, if you have a 64-bit capable Intel processor (i.e., an Intel Core 2 Duo), the software update that you removed should have given you 64-bit Java SE 6 even on Mac OS X Leopard (10.5). Java SE 6 works fine with the VOLANO applets, but unfortunately the Safari browser that runs the applets is only 32-bit on Leopard, so applets in Safari still run with the 32-bit Java SE 5 instead of the 64-bit Java SE 6.
    So you have three options to solve the problem -- two free options (one rather easy, one more difficult), and one easy non-free option.
    (1) The Free and Relatively Easy Option
    If you have an Intel Core 2 Duo processor (not a Core Solo or Core Duo), you can install all the software updates from Apple so that you'll have the 64-bit Java SE 6.
    About Java for Mac OS X 10.5 Update 2 http://support.apple.com/kb/HT2733 "Java SE 6 is available on 64-bit, Intel-based Macs only."
    You would then modify your Java Preferences so that Java SE 6 is chosen first for the Java Application Runtime settings. You can verify the modified setting by running the following "java -version" command from the Terminal application (Finder > Applications > Utilities > Terminal):
    $ java -version
    java version "1.6.0_20"
    Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065)
    Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode)
    There are some more detailed instructions here:
    Install Java 6 on Mac OS X Leopard
    http://gephi.org/users/install-java-6-mac-os-x-leopard/
    Then you can bypass Safari and run the applet directly in the 64-bit Java SE 6 using the "appletviewer" command in Terminal. For example:
    $ appletviewer http://www.actionchat.com/chat/english.shtml
    You just put the URL of the page containing the VOLANO chat applet you want to load. I just tried it on my system, and it works fine. You bypass Java SE 5, which is broken for the VOLANO applets, and you bypass Safari, which cannot run the 64-bit Java SE 6. Instead, you run the VOLANO applet using your Java SE 6 directly!
    (2) The Free and Not-So-Easy Option
    You can download and install SoyLatte as an alternative to the Apple Java VM for your Mac OS X Leopard system.
    SoyLatte: Java 6 Port for Mac OS X 10.4 and 10.5 (Intel)
    http://landonf.bikemonkey.org/static/soylatte/
    I have not tried SoyLatte on my iMac, though.
    (3) The Best but Non-Free Option
    For only $29, you can upgrade your system to the latest Snow Leopard and get both the 32-bit and 64-bit Java SE 6 along with a Safari Web browser that works with Java SE 6 for running applets!
    Mac OS X 10.6 Snow Leopard
    http://store.apple.com/us/product/MACOS_XSNGL
    I hope this information is of help to any Leopard users having trouble with the latest Java update.

    Thanks for the suggestion.
    Please bear in mind that this issue, presumably introduced by Apple's own update, affects not only the command line java interpreter but any other app that depends on Java (including some GUI apps). So it perhaps fits the larger scope of Leopard instead of the Unix area.
    Message was edited by: bhapca

  • 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.

  • Line Break for the column

    Hi,
    I have a BIP Report.
    The report includes the layout of a free text column. This text goes towards the right side for sufficient length.
    I want to wrap the text or line break this text.
    In the rtf template, I am using the following formula:
    <?html2fo: OUTPUT_NOTES?>
    Any Ideas?

    Dear,
    Add the UDF's on the marketing document you want the tax break up.
    Apply FMS using below queries and call these UDF's on your PLD.
    FOR BED
    DECLARE @Amount as Numeric(19,2)
    DECLARE @Rate as Numeric(19,0)
    DECLARE @TAmount as Numeric(19,2)
    set @TAmount =$[$38.21.Number]
    SELECT    @Rate=STA1.Rate
    FROM         OSTC INNER JOIN
                          STC1 ON OSTC.Code = STC1.STCCode INNER JOIN
                          STA1 ON STC1.STACode = STA1.StaCode Where   OSTC.Code=$[$38.160.0] And STA1.SttType='9' order by STA1.EfctDate desc
    set @Amount=(@TAmount * @Rate)/100
    Select @Amount
    For Cess
    DECLARE @Amount as Numeric(19,2)
    DECLARE @Rate as Numeric(19,0)
    DECLARE @TAmount as Numeric(19,2)
    set @TAmount = $[$38.U_BED.Number]
    SELECT    @Rate=STA1.Rate
    FROM         OSTC INNER JOIN
                          STC1 ON OSTC.Code = STC1.STCCode INNER JOIN
                          STA1 ON STC1.STACode = STA1.StaCode Where   OSTC.Code=$[$38.160.0] And STA1.SttType='8' order by STA1.EfctDate desc
    set @Amount=(@TAmount * @Rate)/100
    Select @Amount
    For HCess
    DECLARE @Amount as Numeric(19,2)
    DECLARE @Rate as Numeric(19,0)
    DECLARE @TAmount as Numeric(19,2)
    set @TAmount = $[$38.U_BED.Number]
    SELECT    @Rate=STA1.Rate
    FROM         OSTC INNER JOIN
                          STC1 ON OSTC.Code = STC1.STCCode INNER JOIN
                          STA1 ON STC1.STACode = STA1.StaCode Where   OSTC.Code=$[$38.160.0] And STA1.SttType='10' order by STA1.EfctDate desc
    set @Amount=(@TAmount * @Rate)/100
    Select @Amount
    This will help you.
    regards,
    Neetu

Maybe you are looking for

  • Error importing 4.1 workspace on apex 4.2.1.

    Hi, i recently installed apex 4.2.1. I can login on internal workspace with admin, all ok, but i get errors by importing my old workspace (4.1). I have loaded the exported sql in TOAD to get better error log. Here it is: Error at line 36 ORA-06502: P

  • Max-shm-memory - definition

    Hi Guys, I'm trying to get a clear definition on project.max-shm-memory. Lets say its set to 4GB for user.oracle. Does this mean that the maximum amount of shared memory available to the project is 4GB or that the maximum shared memory segment size c

  • Dynamic client for document styled webservice

    Hi , I created a document styled webservice when I try to run it using DII client I am getting the following problem Exception in thread "Main Thread" javax.xml.rpc.JAXRPCException: failed to invoke operation 'testOperation' due to an error in the so

  • Delete videos in ipod

    hi there, i have a few music videos on my ipod 30g which i would like to delete from it. but when i connect the ipod to my laptop it doesn't show the videos, so i don't know how to delete them. can anybody help me with that? thanks fritz

  • Prompt on Quarter

    Hi I have an object in universe like "Fiscal Quarter". The values of this object are like Q1 FY08,Q2 FY08,Q3 FY08.....I want to create prompt on this object in webi like "Fiscal Quarter between.....and......". As this is character data how will the B