How to write to file using fixed width columns

I need to write some data to a text file such that it is formatted in columns of fixed width. Each column can have different width. eg if i have to write 5 fields in each record the first field would be of 5 characters, second field of 3 characters and so on.
Can u please suggest how I can do it. Its urgent.

Can't you search? Now you know what to google on: java 5 printf
Kaj

Similar Messages

  • How to write a file using mod pl/sql

    hi,
    i am having a submit button in my procedure. which should inturn create .sql file in a file path.
    is there any way to create a fileusing htp and htf methods.
    Thanks in advance
    Hari

    >
    i am having a submit button in my procedure. which should in turn create .sql file in a file path.
    is there any way to create a file using htp and htf methods.
    >
    Why are you wasting your time coding from scratch using the PL/SQL Web Toolkit instead of the APEX framework?
    From Re: how to write a file using mod pl/sql it appears that you are not using APEX, so a number of the approaches APEX offers are not relevant. You appear to be looking for a file download solution using the <tt>wpg_docload.download_file</tt> method, such as:
    create or replace procedure download_file (
        p_filename  in     varchar2
      , p_mimetype  in     varchar2
      , p_content   in out nocopy blob)
    is
    begin
      -- Set up HTTP header.
      -- Use "application/octet" as default MIME type.
      owa_util.mime_header(nvl(p_mimetype, 'application/octet'), false);
      -- Set the size so the browser knows how much to download.
      htp.p('Content-length: ' || dbms_lob.getlength(p_content));
      -- Filename will be used as default by the browser in "Save as..."
      htp.p('Content-Disposition: attachment; filename="' || p_filename || '"');
      -- Close header.
      owa_util.http_header_close();
      -- Stream the file content to the browser.
      wpg_docload.download_file(p_content);
    end download_file;

  • How to create a fixed-width column within an APEX 4 interactive report?

    This thread is a follow-up to {message:id=9191195}. Thanks fac586.
    Partial success: The following code provided by fac586 limits the column width of the Apex 4 interactive report column as long as the column data contains whitespace within a Firefox 3.6 browser:
    <pre class="jive-pre">
    <style type="text/css">
    th#T_DESCRIPTION {
    width: 300px;
    td[headers="T_DESCRIPTION"] {
    width: 300px;
    word-wrap: break-word;
    </style>
    </pre>
    Notes:
    1. The code above is put into the HTML header section for the page.
    2. T_DESCRIPTION is defined as VARCHAR2(2000).
    3. The code above works within the Firefox 3.6.12 browser but does not work within the Internet Explorer 7.0.5730.13 browser.
    I tried adding "float: left;":
    <pre class="jive-pre">
    <style type="text/css">
    th#T_DESCRIPTION {
    width: 300px;
    td[headers="T_DESCRIPTION"] {
    width: 300px;
    word-wrap: break-word;
    <font color="red"> float: left;</font>
    </style>
    </pre>
    Notes:
    1. "float: left;" does not require whitespace and successfully splits the column between characters in lieu of whitespace.
    2. "float: left;" shrinks the cell height and allows the page background to show through... couldn't determine how to fix this.
    3. The code above works within the Firefox 3.6.12 browser but does not work within the Internet Explorer 7.0.5730.13 browser.
    I've done some more research, but I still haven't discovered how to create a fixed-width column within an APEX 4 interactive report that displays properly within an Internet Explorer 7 browser.
    Any ideas and help will be appreciated.

    Thanks for your help with this!
    <pre class="jive-pre">
    what theme are you using?
    </pre>
    A customized version of theme 15.
    <pre class="jive-pre">
    Floating a table cell makes no sense (to me anyway).
    </pre>
    You are correct. I was just trying a different approach ... trying to think out of the box.
    <pre class="jive-pre">
    Think you'll need to create an example on apex.oracle.com with sample data
    if there are any further problems.
    </pre>
    Great suggestion! The code your provided works in the Firefox 3.6.12 browser, but still doesn't work within my Internet Explorer 7.0.5730.13 browser.
    UPDATE:
    I have recreated the problem at apex.oracle.com, you can use the following information to check it out:
    URL: http://apex.oracle.com/pls/apex/f?p=43543:100::::::
    Workspace: IR_FIXED_WIDTH_COLS
    Username: GUEST
    Password: Thx4help
    Application: 43543 - CM_RANDY_SD
    Note: Table name is TEST_DATA
    The following code provided by fac586 works in both Firefox 3.6 and IE7 using default theme "21. Scarlet" at apex.oracle.com; however, it doesn't work when I use a copy of our customized theme "101. Light Blue":
    <pre class="jive-pre">
    <style type="text/css">
    .apexir_WORKSHEET_DATA {
    th#T_DESCRIPTION {
    width: 300px;
    max-width: 300px;
    td[headers="T_DESCRIPTION"] {
    max-width: 300px;
    word-wrap: break-word;
    </style>
    <!--[if lt IE 8]>
    <style type="text/css">
    /* IE is broken */
    th#T_DESCRIPTION,
    td[headers="T_DESCRIPTION"] {
    width: 300px;
    </style>
    <![endif]-->
    </pre>
    Any idea what in the theme could be causing the fixed width column to be ignored in IE 7?
    Edited by: CM Randy SD on Dec 7, 2010 11:22 AM

  • How to display fixed width column in Advanced Table?

    Hi,
    This is probably a newbie question for OAF. My requirement is quite simple but I couldn't find the answer in either the OAF developer's guide or anywhere else so I turn to the experts here. I have a region of type Table or Advanced table with three items in them. One of the Item is of type comments which could be up to 4000 characters.
    I wanted to show all three on the first page but only have fixed width for the comments section like only show the first 50 characters for example and then if they want to see more detail they can click on a link to see full comments.
    The problem is I cannot figure out how to make the comments item fixed width. I have played with the table width properties but it keeps displaying the comments in multiple lines (I don't want that...). I have also tried putting the Table in a Row Layout but it doesn't seem to help.
    Since this is new development I can change my region style to anything to meet my requirements.
    I hope this is an easy question and if someone can help me that would be great....:-)

    Hi,
    Thanks but I was not wanting to change the VO attribute length size since I want to have a link on the first page which would enable to see a user the full 4000 comments using the same VO object. Then if I limit it to 50 characters in the VO, I will not be able to display the full comments on the second page.
    Isn't there some way in the UI that I can limit it? I know one workaround I can use for now is to have another column in the VO with the 50 character value such as substr(comments, 1, 50) and then have the full comments selected also in the VO and then show this subtr value in the first page and the comments value in the 2nd. I just thought there would be an easier way about it then doing all this workaround.
    Any ideas?
    Thanks

  • How to read HTML files using UTL_FILE

    Hello Friends,
    How to read HTML files using UTL_FILE package ? According
    to Oracle documentation UTL_FILE can read or write OS Text Files.
    Thanx in advance..
    Adi

    HI Hareesh,
    i have gone through that blog.
    i tried it...but i am getting mapping error  no receiver determination fond because there are so  many excel files.
    my data is available on sharedString.xml but also it is in not same order.
    i have no clue how to handle this part form the blog.
    "This way our mapping will receive all data from the sheet in an XML format. The only thing that's left is to create an XSD file from the XML file we received in order to be able to use it in the mapping and as our Service Interface and we can proceed with mapping. As you can see from the sheet.xml files all the data is placed with column name and row number so it's not that difficult to map it to an table type format using the Message Mapping only (no java, abap mapping required)."

  • How to write WSDD file to deploy web service

    I write a server code,I want to deploy it as service,but I don't know how to write WSDD file?I use AXIS and SOAP
    I need help,thanks a lot.
    Regards
    William
    2.24

    Yes, put your wsdd with your class files. But if you want AdminClient to work correctly, be sure all environement variables are set correctly.
    Me, I never use it, I prefer to modify directly the server-config.wsdd

  • How to write text file in Shockwave?

    Does anybody know how to write text file in Shockwave to
    user's disk?
    Thanks in advance.

    Those Xtras can wreak to much havoc when used with the wrong
    intent.
    What you can do is write with setpref and store a list of
    saves and the
    saves itself seperatly. Then you'd have to build your own
    save/open
    dialog to let the user:
    * pick a previously saved file to load or overwrite
    * have the user type the name of a new file to save.
    Only thing that remains is that the user cannot decide where
    the files
    are saved.
    Manno
    SiuLinda wrote:
    > Thanks a lot for your reply.
    > Yes, cookies is good but I have to write a program to
    save the text file in
    > where the user wants, user can open these files later if
    they like, like using
    > Filextra and Fileio, but I found all of these xtras seem
    to be not supported in
    > shockwave.
    >
    Manno Bult
    [email protected]

  • How to write a application using WDJ with the adobe form ?

    Hi, experts,
    I don't know how to write a application using !!webdynpro for java!! with the adobe form so that I can fill data to the adobe form and get data from the adobe form.
    Note: I have configed the ADS(adobe document services),and I can create a application with a interactiveform in webdynpro for abap and run it successfully, so that I can  fill data to the adobe form and get data from the adobe form.
    Do you give me some hint?
    Thanks a lot.
    Best regards,
    tao
    Edited by: wang tao on Sep 9, 2008 8:59 AM

    Hi,
    Refers the following links.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4fd2d690-0201-0010-de83-b4fa0c93e1a9
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5f27e290-0201-0010-ff82-c21557572da1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c9a954-aa20-2a10-64bb-ea0835204e03
    Thanks
    Abhilasha.

  • How to read pdf file using file adapter

    Hi..
        How to read pdf file using file adapter?
    regards
    Arun

    Hi
    This may help you
    /people/sap.user72/blog/2005/07/27/xi-generate-pdf-file-out-of-file-adapter
    /people/alessandro.guarneri/blog/2007/02/21/sap-xi-acting-as-a-huge-file-mover
    ---Ram

  • How to upload multiple files using wicket

    Hai,
    how to upload multiple files using wicket at a single browse.
    any suggestion?
    Thanks in advance

    You have to do this your self by either (as vinod said) using a different component (not present in adf) or implementing this:
    1) allow the user to select multiple filenames (somehow)
    2) zip them together
    3) upload the zip
    4) unpack the zip on the server
    5) work with the files
    Timo

  • How to Upload a File using FileReference + PHP??

    How to Upload a File using FileReference + PHP??
    If you could help me with a two code examples the AS code and
    the PHP code of a working example.
    Thanks
    Jorge

    http://www.flash-db.com/Tutorials/upload/upFiles.php?page=1

  • How to access xml file using c

    how to access xml file using c. are there any libraries regarding xml fastinfoset in c? Please let me know about any resources if u know? thanks!!!
    samitha

    There are different methods to access XML data which have pro's and cons. Let us know more about what you want to do and we can help you.

  • How to write SELECT statement using tables ekko,ekpo and eket?

    Hi,
    I got a problem in  performance tuning using below tables?
    how to write SELECT statement using tables EKKO,EKPO and EKET and in conditon ( WHERE clause)  use only fields 
                        ekko~ebeln       IN ebeln
                       ekko~loekz       EQ ' '
                       ekko~lifnr       IN lifnr
                       ekko~ekorg       IN ekorg
                      ekko~ekgrp       IN ekgrp          
                       ekpo~werks       IN werks
                       ekpo~pstyp       EQ  '3'
                       ekpo~loekz       EQ  space
                       ekpo~elikz       EQ  space
                       ekpo~menge       NE  0
                     eket~rsnum       NE space.
    Thanks in Advance.
    bye.

    Hi,
    ekko~ebeln IN ebeln
    ekko~loekz EQ ' '
    ekko~lifnr IN lifnr
    ekko~ekorg IN ekorg
    ekko~ekgrp IN ekgrp
    ekpo~werks IN werks
    ekpo~pstyp EQ '3'
    ekpo~loekz EQ space
    ekpo~elikz EQ space
    ekpo~menge NE 0          " Remove this from where clause
    eket~rsnum NE space.    " Remove this from where clause
    ' instead delete the entries after fetching into the table
    DELETE it_itab WHERE menge EQ '0' AND rsnum EQ ' '.
    Regards
    Bala Krishna

  • How to run .jar on linux & how to create .jar file using java?

    hi, may i know how to run .jar on linux & how to create .jar file using java? Can u provide the steps on doing it.
    thanks in advance.

    Look at the manual page for jar:
    # man jar
    Also you can run them by doing:
    # java -jar Prog.jar

  • My mac book startup disk is full and when I start it, it give me a blank blue screen. I have tried the shift and I started in safe mode, and it gave me the stars screen. How can I delete files to fix the problem

    My mac book startup disk is full and when I start it, it give me a blank blue screen. I have tried the shift upon start
    and I started in safe mode, and it gave me the stars screen. How can I delete files to fix the problem

    1. Start up in Safe Mode.
        http://support.apple.com/kb/PH11212
    2. Empty Trash.
        http://support.apple.com/kb/PH10677
    3. Delete "Recovered Messages", if any.
        Hold the option key down and click "Go" menu in the Finder menu bar.
        Select "Library" from the dropdown.
        Library > Mail > V2 > Mailboxes
        Delete "Recovered Messages", if any.
        Empty Trash. Restart.
    4. Delete old iOS Devices Backup.
        iTunes > Preferences > Devices
        Highlight the old Backups , press “Delete Backup” and then “OK”.
        http://support.apple.com/kb/HT4946?viewlocale=en_US&locale=en_US
    5. Re-index Macintosh HD
       System Preferences > Spotlight > Privacy
       http://support.apple.com/kb/ht2409

Maybe you are looking for

  • OS 10.4.6 is causing color shift in prints

    Since I updated to 10.4.6 My prints have a severe red cast to them. All perameters used in printing are the same as previous and my Epson 2200 is working properly. I have color managment turned off in the driver and am using the correct prifiles fo t

  • Help Plz--I get an error message when I try and open iTunes

    My PC crashed and I had to reboot to factory start ups. Luckily, it kept all my files including my iTunes library. The problem is that everytime I try to open iTunes I get a message saying iTunes had encountered a problem and needs to close. I tried

  • Outbound Delivery Creation without OPEN quantity in SD scheduling agreement

    hi, We have a customer requirement, where user 's should be able to create outbound delivery irrepective of open quantity in Sales document. In Vendor Direct Ship scenario where vendor ships goods to customer directly and sends Inbound 856 EDI messag

  • AUTHORIZATION

    I have a problem with the authorization of my computer: I'm signed in in the itunes store, buy a song, but when i want to play it I have to again enter my password. everytime i open and close itunes i have to enter my pasword for every song! don't kn

  • Error Occured in BUILD_DRIVER

    I am facing following error in cube maintenance while submitting maintenance job to oracle queue. ***Error Occured in BUILD_DRIVER: It doesnt gave any other reason. I deployed everything on another machine with same patches, it works fine there.. but