How to output to a file in table format?

I would like to output my result in table format, for example:
1, 305,134
2, 245,98
1, 34,204
3, 205,315 etc.
Any ideas how to do it?
I have tried PrintWriter class and it work but when I used JFileChooser to choose to load an image file, there is no file output.

Hi !
Do something like this :
try{
FileWriter fw = new FileWriter("youroutputfilename.txt");
BufferedWriter buff = new BufferedWriter(fw);
for(int i=0; i < [end of your loop]; i++){
buff.write(data1+";"+data2+";"+data3+";"+.....);
buff.close();
}catch(IOException e){System.out.println("couldn't write the file");}
I hope it helps .
stephane

Similar Messages

  • How can I keep a PDF's table format intact when exporting to Excel? I am using Reader X for windows.

    I am trying to use Reader X/ Adobe Export to send a pdf to excel but everytime I send it and then open the excel file the table format and information is all screwy. How can I fix this.  I am trying to put together pricing sheets for my workshop.  Thanks and I hope someone can help.
    _Rob

    You'll want to ask at Adobe's forum for the ExportPDF.
    http://forums.adobe.com/community/exportpdf
    Be well...

  • How to put check box in a table format at the out put ?  Urgent issue...

    Hi,
    I am working an assignment to assign multiple roles for multiplr user.
    In selection screen we have to enter mutiple EMPNO from ..to
    1)  in second screen we will get the empno, First name, last name,  Position,
        From  date, To date, Sap user ID, Email id in the table formate with first
        column  with Check box.
    2) In second screen below the table I have to place the multiple roles just like in
       the step  loop format and below this one Execute button should be there.
    If we select the multiple employees or single employee and place the multiple roles or single roles and if I click the execute button then the multiple roles will be assigned to the multiple employees. The empno and roles will come from table and step loop to internal table and the same will pass to the BDC.
    For this requirement I prepered recording for Transaction PFCG. But I can't understand how to design the second screen that table format and the step loop format. Can anybody give any idea or any coding to design  the second screen.
    and how to meet the requirement. This is urgent issue. Good SDN points will be reworded.
    Witing for kind response.
    Thanks in advance.
    Bansidhar

    Hi upendra
    There are slight changes in the sivas code.Where is the data coming into the table.If its from a Model Node then iterate each element of the source node get that value compare and set the corresponding value in the element of the node binded to table.
    Create a boolean attribute "select" in the table node and bind it to checked property of the check box.
    for(int i=0;i<wdContext.node<tablenode>()..size();i++)
    if(wdContext.node<tablenode>().get<tablenode>ElementAt(i).select())
    wdContext.node<tablenode>().get<tablenode>ElementAt(i).set<yourattribute>(true);
    else
    wdContext.node<tablenode>().get<tablenode>ElementAt(i).set<yourattribute>(false);
    See the attribute is boolean so pass true or false as a values in setter methods.
    Regards
    Kalyan

  • Anyone know how to output an XML file from ABAP to a non sapgui location?

    I have a program that creates XML and then outputs a file via CALL METHOD cl_gui_frontend_services=>gui_download. But now I want to execute the program in background mode and therefore I need to be able to output that XML to a NON sapgui file location. Current code creates the XML to an internal table which is binary then the gui_download method converts that to output XML. .  Does anyone know how I can change the code to either a) output the XML to an internal table which can be output via, say, a TRANSFER command..or, b) output the created binary table of XML to a NON sapgui file location?
    Excerpts from current code are as follows:
    first the XML is created (to the binary file)
          Creating a ixml factory
      l_ixml = cl_ixml=>create( ).
          Creating the dom object model
      l_document = l_ixml->create_document( ).
          Fill root node with value XML
      l_element_xml  = l_document->create_simple_element(
                  name = 'XML'
                  parent = l_document ).
          Create tag 'HEADER' as child of 'XML'
      l_element_header  = l_document->create_simple_element(
                  name = 'HEADER'
                  parent = l_element_xml  ).
    header information about the file and general data about the fleet follows
      l_value = c_fleet_import.
      l_element_dummy  = l_document->create_simple_element(
                name = 'TYPE'
                value = l_value
                parent = l_element_header ).
    etc.......
    then the xml is connected to the stream factory and rendered
      Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
      Connect internal XML table to stream factory
      l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).
      Rendering the document
      l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                            document = l_document ).
      l_rc = l_renderer->render( ).
      Saving the XML document
      l_xml_size = l_ostream->get_num_written_raw( ).
    and then output to the file
      IF sy-subrc = 0.
        CALL METHOD cl_gui_frontend_services=>gui_download
           EXPORTING
             bin_filesize = l_xml_size
            filename     = 'g:\sapdms\BSCC-DEV\EFPAC XML Files\ALL.xml'
           filename     = '/TRICK/727/OUT/ZEFP/EFPAC.XML' "doesnt work with sap gui
             filetype     = 'BIN'
           CHANGING
             data_tab     = l_xml_table
           EXCEPTIONS
             OTHERS       = 24.
    as implied by the comments the method above will successfully output the XML file to the g:drive but will not output to /TRICK/ location, which is where I need it to go in a background mode run.
    This is a problem which has defeated all our local expertise and I would appreciate any help given... Barry Jones

    Try this code below:
    data  l_xml_table2  type table of xml_line with header line.
    W_filename - This is a Path.
      if w_filename(02) = '
        open dataset w_filename for output in binary mode.
        if sy-subrc = 0.
          l_xml_table2[] = l_xml_table[].
          loop at l_xml_table2.
            transfer l_xml_table2 to w_filename.
          endloop.
        endif.
        close dataset w_filename.
      else.
        call method cl_gui_frontend_services=>gui_download
          exporting
            bin_filesize = l_xml_size
            filename     = w_filename
            filetype     = 'BIN'
          changing
            data_tab     = l_xml_table
          exceptions
            others       = 24.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
                     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.

  • How to output a postscript file with .ps extension name in jsp?

    Hi,
    I could use a servlet to output a postscript file with .ps file extension name. But I tried to do the same with jsp, for some reason, jsp always outputs a file with .jsp extension name though the content is postscript. Could anyone help me on this? Here is my jsp code:
    <%@page contentType="application/postscript"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import="java.util.*" %>
    <%@page import="java.io.*" %>
    <jsp:useBean id="corresv" class="oiintranet.CorresVBean" scope="request"/>
    <%
    response.setContentType("application/postscript");
    String corresId = request.getParameter("Id");
    corresv.setCorresId(corresId);
    PrintWriter output = response.getWriter();
    output = corresv.getResult(output);
    output.flush();
    %>
    In the bean corresv:
    public class CorresVBean extends BaseBean {
    private String corresId;
    public void setCorresId(String s) {
    this.corresId = s;
    public PrintWriter getResult(PrintWriter output) {
    //get postscript file content from a socket, one string line each time until reaches "X_END"
    String str;
    while ((str = in.readLine()) != null) {
    if (str.equals("X_END")) break;
    output.println (str);
    output.close();
    }catch(Exception e) {
    e.printStackTrace();
    return output;
    Thank you in advance.
    Geraldine

    Hi
    Every time u want to make a file u need to make its extension. I am talking
    about general scenario like word, excel so even when u make spool file
    so u need to give extension.
    like
    Spool temp.sql
    it will save u r file as sql file.
    hope it will help
    regards

  • How to read the AFP file in hex format

    hi,
    I am reading a AFP file in hexstring format.But it is out put is not perfect means it is showing output close to the real one.
    How to read the file so taht i can get exact output in hex format.
    try{         
                        File inputFile = new File( "C:\\ACode\\afpfile.afp" ) ;
                        File outputFilehex = new File ( "C:\\ACode\\Hex.txt" ) ;
                        FileInputStream inputStream = new FileInputStream( inputFile );
                        Reader in = new InputStreamReader(inputStream,"Cp1252");
                        BufferedReader readableFile = new BufferedReader( in ) ;
                        FileOutputStream outputStreamhex = new FileOutputStream( outputFilehex );
                        Writer outhex = new OutputStreamWriter(outputStreamhex);
                        BufferedWriter writableFilehex = new BufferedWriter( outhex ) ;
         int line;
         String hext=new String();
         while ((line= (readableFile.read()))!=-1)
              writableFilehex.write(Integer.toHexString(line).toUpperCase());
         } writableFilehex.close() ;
    readableFile.close() ;
    catch( IOException e ) {
         System.out.println( e.getMessage() ) ;
         

    while reading i am getting most of hex charters are same except some places like instead of taking 00 its writing 0 and instead of f8 its writing fff.
    AFP is a IBM format for printing. Somehow i will be able to read that but how to covert it back to that format and store to that file.
    by trying is just storing data in hex format only
    Writer outhex = new OutputStreamWriter(outputStreamhex,"Cp1252");
    is there anyother way to store it back to this format

  • How to load a flat file with utf8 format in odi as source file?

    Hi All,
    Anybody knows how we can load a flat file with utf8 format in odi as source file.Please everybody knows to guide me.
    Regards,
    Sahar

    Could you explain which problem are you facing?
    Francesco

  • How to produce an XML file in OAGIS format ( for Vendor Master & Invoices)

    Hi Guys,
    I've requirement to produce an XML file in OAGIS format ( for Vendor Master & Invoices) under Oracle AP and PO.
    Any inputs?
    thanks.

    Not sure,you are looking for inbuild product to produce the OAG XML format, or trying to build custom one.
    If options is Inbuild Product, Oracle Exchange is yeh another product has such kind of capability. Refer this
    http://download-west.oracle.com/docs/cd/A97329_03/web.902/a88894/adx16orx.htm#1007387
    FOr second , check out these two document in metalink
    150083.1 XML Utilities
    123491.1 How To Insert XML Documents Into The Database And Validate Them Using PL/SQL ?
    Hope this will be help

  • How to display 'List' of objects in table format

    I am trying to display bunch of records in the table format.
    I have the List of bean object populated with table datas.
    Currently the code is working fine ,if I tend to display one record.I am wondering how to display all the records.
    I know theres a 'Fieldloop'.If thats the one please explain with example.

    iterate the object list using field loop. eg. is given below
    [      <Field name='MatchTable'>
    <Display class='SimpleTable'>
    <Property name='columns'>
    <List>
    <String>title</String>
    </List>
    </Property>
    </Display>
         <FieldLoop for='name' in='userlist'>
    <Field name='username'>
    <Display class='Label'>
    <Property name='labels'>
    <ref>name</ref>
    </Property>
    </Display>
    </Field>
         <FieldLoop>
         </Field>

  • HOW TO SAVE A SCANNED FILE IN PDF FORMAT

    I HAVE A HP LASER JET M1005MFP PRINTER...
    HOW CAN I SAVE A SCANNED FILE IN PDF FORMAT..???
    PLEASE HELP AS SOON AS POSSIBLE AS IT IS URGENT.

    To get your issue more exposure I would suggest posting it in the commercial forums since the LaserJet M1005 is a commercial product. You can do this at Commercial Forums.
    I hope this helps!
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

  • How to convert cXML dtd files into xsd format and use them into BPEL application

    Hi,
    In my BPEL application I have to use cXML dtd files by converting them into xsd format.
    I have used 'Microsoft Visual Studio' for converting cXML.dtd file into xsd format, for this 1 dtd file I am getting three xsd files (cXML.xsd, cXML1.xsd and cXML2.xsd).
    Please check this once and let me know
    1. why I am getting three xsd files for one dtd file,
    2. how can I use cXML.xsd file in my application, do I ll have to use all the three files in my BPEL app and
    3. what should I include in main xsd file (cXML.xsd) to import other two xsd files.
    kindly check this once and let me know your suggestions .
    Thanks

    Hi,
    While downloading the cXML dtd there will be example xml files. Using this xml's we can generate xsd.
    Regards,
    KANN.

  • How to recover my business files from a formatted removable drive?

    I need to recover my business files from my formatted drive accidentally. I know I am stupid. I am using Windows XP. It is a Toshiba 500GB external hard drive.
    Is there anyone that can help me to restore my files back? The inner files are really important to me. Help, please!

    Well! If you really know little about data recovery stuff, I think I could help.
    Actually, after you Google “data recovery tools” on the internet, you could see plenty of data recovery tools available online. Some of them are free, some of them are not. You should put much more attention to this point and make a wise
    decision according to your won needs.
    Here are some freeware for you:
    http://www.piriform.com/recuva
    http://www.formatrecovery.blogspot.com/2013/02/recover-data-after-formatting.html
    Here are some paid tools for you:
    http://www.techsupportalert.com/best-free-data-recovery-file-undelete-utility.htm
    You should read these articles to know more information about data recovery stuff and select a right one:
    http://en.wikipedia.org/wiki/Data_recovery
    http://en.wikipedia.org/wiki/List_of_data_recovery_software
    Thank you for your prompt replies. I will try your recommended tools latter. Thank you very much!!!!!

  • How to output executable Bin file under linux from java

    Hi
    im beginner in java under linux and i want to out put my java programs to be bin files that can run
    if this not possilble
    how to run the output jar files with just double click ?
    does i have to run sh file that do the hob how?
    thanks in advance.

    say your main method (application's entry point) is located in a class com.my.Class,
    then first you create a text file (say, manifest.txt) that contains this line:
    Main-Class: com.my.Class
    [/code}
    and then you append this to the jar's manifest as such:
    jar cfm yourjarfile.jar manifest.txt [additional files you might want to add]
    for more info,
    http://java.sun.com/docs/books/tutorial/deployment/jar/manifestindex.html                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to insert data from file to table??

    I need to know that how can i insert data in multiple column through file. I can simply insert data in one column table but couldnt find out the way to put data in all column.
    My data store in a file
    ************************************************text.txt***************
    133, shailendra, nagina, 14/H, 45637, 9156729863
    **************************************************************my_data(table)**********
    trying to insert into below table...
    id, name, last_name, add, pin. mob
    Let me know if anything else needed..:)

    Hi Shailendra,
    Actually, in SQL Developer, you can open a connection to the target schema, right-click on the Tables node in the navigator tree view, select Import Data, then use the Data Import Wizard. It is extremely flexible. It looks like you have a comma separated variable file, so if you select Format: csv and Import Method: insert it will probably work just fine.
    To minimize the chance of errors during import, pick a preview limit value so the wizard can examine the size and data type of all columns in as many data rows as possible, then review the data type/size for each column in the next wizard page and override as necessary. For date columns it is also important to choose the appropriate format mask.
    Hope this helps,
    Gary
    SQL Developer Team

  • How to save as .ai file to .eps format ??

    Hi all,
    Could anyone help me out on the below problem.
    I need to write a script which will save a .ai file to .eps file format and store in  to a fixed location. (Ex \\10.99.0.60\epsfile\)..
    This action should happen on executing the script.
            Here we don’t need to enter the file name .It will be saved to the same file name. We just have to change the extension of the file and store it to a fixed location.        Ex: when the current file name is ‘test.ai’ the output file name will be ‘test.eps’
    Please help me on the abhove issue.
    thanks and Regards,
    sanat

    Try this. Cut and paste into the AppleScript Script Editor Application. Save as whatever name in HD>Applications>Adobe Illustrator CS4>Presets>Scripts folder and restart.
    This will open all files of the fileTypes in a folder and resave them as AICS4 files with compression and PDF compatibility. It will do a folder only not a Directory. You'll have to put in your own error handling for bad fonts. It makes all files CMYK and updates legacy text.
    -- BEGIN CODE
    set fileTypes to {"EPSF", "PDF ", "ART5", "TEXT"} -- file types available to resave as Illustrator
    -- get a sourceFolder that holds the files to resave as AI
    set sourceFolder to (choose folder with prompt "Choose a folder with files to resave as Illustrator:") as text
    -- get a list of files of the defined type in the sourceFolder
    tell application "Finder" to set workingFiles to (every file of folder sourceFolder whose file type is in fileTypes) as alias list
    -- now you have your fileList argument
    -- get a destinationFolder to hold the PDFs
    set destinationFolder to choose folder with prompt "Choose a folder to hold the Illustrator files:"
    SaveFilesAsIllustrator14(workingFiles, destinationFolder)
    on SaveFilesAsIllustrator14(fileList, destinationFolder)
        set destinationPath to destinationFolder as string
        repeat with aFile in fileList
            tell application "Finder"
                set fileName to displayed name of aFile -- get displayed name
                set AppleScript's text item delimiters to "."
                set newFileName to text item 1 of fileName
                set newFilePath to destinationPath & newFileName & ".ai"
            end tell
            tell application "Adobe Illustrator"
                open aFile forcing CMYK with options {update legacy text:true}
                save current document in file newFilePath as Illustrator with options {class:Illustrator save options, embed linked files:true, PDF compatible:true, font subset threshold:0.0}
                close current document saving no
            end tell
        end repeat
    end SaveFilesAsIllustrator14
    -- END CODE

Maybe you are looking for

  • How can I clone a completed Exchange Server 2013 in a Lab Enviroment?

    I was having great time with my Exchange Server 2013 until I tried to clone it to avoid fresh installation of another Exchange 2013 server. Steps taken (1)Clone the Exchange1 and turn it off (2) Brought the Clone Exchange2, renamed it, change the IP

  • Assigning a value to a record attribute ,where attribute changes dynamicall

    Hi all, i am writing a procesure in which ... i want to assign values to a record whose attributes changes dynamically depending on the variable value... below is the code in which i am trying to assign values to a record type rec_ce_stmt_int_tmp & i

  • How to re-install Adobe Acrobat Standard XI after re-format my computer?

    Hi,. I purchased Adobe Acrobat Standard XI last year and I re-formated my computer 1 month ago and all software have been removed from my computer including the Adobe Acrobat Standard XI. I would like to know how can I retrieve/ re-install it? I trie

  • Importing business area and then using workbook file

    I need to use a workbook that was created by another user and saved as an external file. They exported their business area and sent it to me with the workbook. When I tried to open the workbook after sucessfully importing the business area I could no

  • PCI-6014 not recognized by Windows 2000

    I recently purchased and just installed a PCI-6014 in a new Dell Optiplex running Windows 2000 (sp2, we have stayed at sp2 due to problems we have had with sp3, sp4). On this same machine I have LabVIEW 7.0 with all the bells, including NI-DAQ 7.0. W