Format output so file is readable

Hi All.
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
PL/SQL Release 9.2.0.4.0 - Production
CORE 9.2.0.3.0 Production
TNS for Solaris: Version 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production
on
SunOS rcworaprd 5.9 Generic_112233-07 sun4u sparc SUNW,Sun-Fire-480R
I have a script that is running some sql to report free space in tablespaces. The output goes to a file and the formatting is great when I vi the file but once I email it the columns don't line up. I was wondering if there is an easy way to get everything lined up correctly:
Here is the sql I run:
sqlplus <<! > $SCRIPTHOME/shrink.tmp
/ as sysdba
set pagesize 100
set linesize 300
set verify off
column file_name format a50 word_wrapped
column currsize format 999,999,990 heading "Current|Size|(MB)"
column smallest format 999,999,990 heading "Smallest|Size|(MB)"
column savings format 999,999,990 heading "|Savings|(MB)"
break on report
compute sum label "TOTAL SPACE SAVED BY SHRINKING" of savings on report
column value new_val blksize
select value from v\$parameter where name = 'db_block_size'
select file_name,
ceil( blocks*&&blksize/1024/1024) currsize,
ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) smallest,
ceil( blocks*&&blksize/1024/1024) -
ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) savings
from dba_data_files a,
( select file_id, max(block_id+blocks-1) hwm
from dba_extents
group by file_id ) b
where a.file_id = b.file_id(+);
exit
Output in report file all lines up but don't line up in email (tabs are different etc...)
Any way to get this formatted?
Thanks
Jamie

Most likely it is an issue with the fonts that are being used for display. Typically, telnet or ssh applications use a fixed width font for display so all characters are the same size. Most Windows applications tend to use a proportional font by default, so different characters have different widths.
So, unless you can persuade all of the recepients to use a fixed width font in their email readers, you are likely out of luck.
John

Similar Messages

  • Formatting output to file

    I want to format the output of a file to say 10 spaces no matter what the size of the string. For example if I did this
    out.write("dog");
    out.write("horse");
    out.write("cat")
    I want the output to be
    dog horse cat.
    Thanks for the help

    Wait... you mean you want to add a certain amount of spaces to a String so that the String has a length of 10?
    If that's what you want you could do something like this.
    final int LENGTH = 10;
    public String addSpaces(String str) {
        if (str.length() >= LENGTH) {
            return str;
        while (str.length() != LENGTH) {
            str += ' ';
        return str;
    }Then you could do
    out.write(addSpaces("dog"));
    out.write(addSpaces("horse"));
    out.write(addSpaces("cat"));
    // etc..and you would get:
    dog       horse     cat      

  • How to use an .xsl file to transform input XML to re-formatted output XML?

    Hello,
    I have a .xml file from a report that I want to use a stylesheet to transform into a different .xml format.
    I am reading that I can create a .xsl file to read my input and then transform it to a new output .xml file.
    How do I load this into the Apps?
    I tried creating a template definition and loading the .xsl in as type 'XSL-TEXT' and also, I added
    <?xml-stylesheet type="text/xsl" href="Transform.xsl"?> to my xml data source. The output looked the same as the input.
    Has anyone done this before? Any suggestions would be great!
    Thanks
    -CC

    This is how I use e4x with HTTPService:
    import mx.collections.XMLListCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable] private var claimsXLC:XMLListCollection;
    private function claimsHandler(evt:ResultEvent):void{
        claimsXLC = new XMLListCollection(evt.result..claim as XMLList);
    XML data is being returned, but I use XMLList to create the XMLListCollection.
    If this post answers your question or helps, please mark it as such.

  • I would like to know the list of possible output (export) file codec from FCP X. For example, can I export  in F4V or FLV format?

    I would like to know the list of possible output (export) file codec from FCP X.  For example, can I export  in FLV format?  Where do I find the list, which gives me all the details about it?  Or is there only one output codec? Thanks

    That's an excellent analogy. While FCP cannot export FLV. It is possible to do a very simple substitution. If you export a QuickTime movie using the .mov suffix with the H.264 codec, you can change it to FLV simply by changing the suffix to .flv. This is an acceptable format for Flash movies on most web sites, if that's where you're trying to go.

  • Formatting output to a file? 1.4.2

    I am writing an application that writes result sets from an oracle 10g database query. This output combines both text and numeric.
    I cannot figure out how to justify the output to the right or left or force the fields to use a set amount of space regardless of the width of the text.
    As a result I get an outfile with perfectly lined up columns except for the one or two where instead of a four digit number there is a single number. This change in width shifts all of the output over.
    My customer goes nuts over this, surely there is a way to format output?

    OK, I tried today, I really did, I just can't get my brain around how to do what I need to accomplish so here is a pseudo example and i am hoping someone can shed some light.
    My application is abstract to enable easy addition of instances of automated reports.
    I have a 2d array that contains the column names for a given query. [0] = column name, [1] = space to be applied after results are added to a string buffer.
    So, something like this:
    StringBuffer entireQueryResults = new StringBuffer();
    String[][] QueryColumns = someObject.getQueryColumnNames();
    ResultSet currResults = someObject.getResultset();
    while(currResults.next()){
    String currRow = "";
    for(int i = 0; i < QueryColumns.length; i++){
       currRow = currRow + currResults.getString(QueryColumns[0])+currResults.getString(QueryColumns[i][1])+"\n";
    entireQueryResults.append(currRow);
    Now, the problem is that there are columns in the queries that have digits, these can range from a single val to 5 and while 98% of them are 3 digits there are random instances where they are a single digit or even a -1. When this happens it throws the output way off and makes it difficult to read in the resulting email report.
    How can I incorporate this into a MessageFormat or ChoiceFormat object to make the output pretty ?

  • Why when I open the output.txt file, is strange code there, not 3.1

    i almost copy the example from "think in java book" chapter 11
    however, the result "output.txt file" when opened by notepad of windows xp, always only very strange code inside, not what i want
    do i need open the file, before i want to write?
    or i use a wrong api again?
    or the java code norm is very difference from ms windows?
    thanks
    import java.util.Random;
    import java.io.*;
    class CreatRandomFile
         public static void main(String args[])throws IOException
              File fileOutput=new File("output.txt");
              DataOutputStream out2=
                   new DataOutputStream(
                        new BufferedOutputStream(
                             new FileOutputStream(fileOutput)));
              out2.writeDouble(3.1);
              out2.close();
         }//end main
    }//end class

    There are basically two ways of IO:
    a) human readable format;
    b) machine readable format;
    What you've just done is writing a double value in machine readable
    format to a file. Some folks call it 'binary format'. I bet your file is eight
    byes long. A DataOutputStream writes data in machine readable
    format. You need a PrintStream instead if you (a being human I suppose)
    want to be able to read the contents of that file.
    kind regards,
    Jos

  • Format of CSV file generated through iBot

    What is the default format of csv file generated through iBot (UNICODE / UTF) ?
    How can we configure a single iBot to generate CSVs, for example, in UTF format instead of UNICODE (assuming UNICODE is default).
    -Jimit

    Use this
    https://support.oracle.com/epmos/faces/ui/km/SearchDocDisplay.jspx?_afrLoop=324436281886916&type=DOCUMENT&id=1459947.1&displayIndex=1&_afrWindowMode=0&_adf.ctrl-state=130oxyc5cv_71
    Content:
    Goal
    Currently the CSV format in Agents always delivers the report results in tab delimited CSV. Is there a setting that can make the report result in a comma delimited CSV format when the reports are setup via Agents/iBots?
    Fix
    There is no setting that would make CSV output from an iBot be comma delimited as opposed to the tab delimited output from the web UI.
    There is an enhancement request for this functionality. for more information, see bug 13802667 - COMMA DELIMITED CSV FORMAT FOR AGENTS/IBOTS has been logged to include this feature in future release.
    As a work-around, you can to run a custom script from an Agent to convert tabs to commas. See chapter 4 (http://docs.oracle.com/cd/E21764_01/doc.1111/e18562/schedjobscripts.htm#BABGFBBD) of Oracle® Fusion Middleware Scheduling Jobs Guide for Oracle Business Intelligence Enterprise Edition 11g Release 1 (11.1.1) Part Number E18562-01 for more information on writing custom scripts.
    If helps pls mark

  • List format output to excel sheet

    Hi,
        I have a report output in list format. I need to download that into excel sheet. Is it possible to download a list format output to excel sheet or shall I need to convert that into grid format?
    Thanks Barnita.

    HI,
    Use Menu path
    List->Save/Send->File path

  • Maximum output pixel file size for Premiere Pro CC

    Anyone know what this is? I need to output a file to match 5760x2160

    I just tried playing the exported output and Quicktime did not work.  Maybe AME has some ultra high resolution formats that can be customized.  There has to be ways to export UHD but I have not used AME much recently.
    When you said you could not get the numbers did you mean for the sequence or for export?

  • How to upload pdf file format in unix file directory?

    how to upload pdf file format in unix file directory?

    Hi Karthikeyan,
    If you have PDF internal table with you, You can follow the below method to upload into Unix directory.
        DATA:file_path TYPE char100 VALUE '/usr/sap/tmp/rep_out.PDF'.
        OPEN DATASET file_path FOR OUTPUT IN BINARY MODE.
        IF sy-subrc EQ 0.
          LOOP AT it_pdf.
            TRANSFER it_pdf TO file_path.
          ENDLOOP.
        ENDIF.
        CLOSE DATASET file_path.
    Thanks
    Venkat.O

  • Not receiving the output xml file from BPM

    Hello
    I am doing a scenario where I'd be sending two files in text format to the BPM workflow which would be using Fork and Correlation to merge these two files into one file and send the output xml file as receiver. Problem is that the two files are successfully converted into the xml messages and are displayed in SXMB_MONI but the output file which would be received from BPM engine as receiver is not being generated and displayed in SXMB_MONI as well as RWB. Please suggest any probable solution.
    Thanks.

    I don't think you can manipulate .ai files in Flex /
    AIR.

  • JSP XML output to file system

    I hava a JSP application that uses the XDK to query the database and display XML rowset data to a JSP. This rowset data can be a few hundred rows or up to 50,000 rows,
    as we publish technical manuals, parts manuals and wiring manuals for aircraft.
    Getting the data to display within the JSP is not a problem. The problem is
    that the XML rowset data shares two purposes:
    1. Query by Example, returning
    XML formatted data for display within a browser.
    2. Use of the XML formatted
    data as an external entity file for our SGML authoring software to print the
    paper publication.
    The JSP I developed (I'm not sure I should take credit for it) uses the XMLData bean and it will open the browser File/SaveAs dialog in both Netscape (Unix) and IE5.5 (Windows). HOWEVER, when I create a second JSP to perform the same task on a different table the JSP errorpage shows with no error and no errors within the JDeveloper console. This has been kicking my butt for some time, and would very much appreciate a workable solution. I will share whatever I can share with the provider. Here is the JSP code.
    =============================================
    <?xml version="1.0"?>
    <%@ page language = "java" errorPage="errorpage.jsp" import = "java.io.*, java.util.*, oracle.jbo.*, javax.naming.*, oracle.jdeveloper.html.*, oracle.jbo.html.databeans.*" contentType="text/html;charset=ISO-8859-1" %>
    <jsp:useBean class="oracle.jbo.html.databeans.XmlData" id="h25EqXml" scope="request" >
    <%
    h25EqXml.setResultElement("equiptbl");
    h25EqXml.setReleaseApplicationResources(true);
    h25EqXml.setDisplayAttributes("Ein,Pnr,Nomen,Cage,Diagnbr,Sht,Effect");
    h25EqXml.initialize(pageContext,"h25Wires_JspApp_h25Wires_be_H25Wires_beModule.HU25A_Equipment");
    response.setContentType("text/sgml");
    response.setHeader("Content-location","attachment;filename="+"equiptbl.sgm");
    ServletOutputStream sos = response.getOutputStream();
    BufferedInputStream bis = new BufferedInputStream (new FileInputStream("equiptbl.sgm"));
    int data;
    while((data = bis.read()) != -1)
    sos.write(data);
    bis.close();
    sos.flush();
    sos.close();
    %>
    <jsp:forward page= "HU5A_Equipment_Browse.jsp" />
    </jsp:useBean>
    ============================================
    The code for the other pages is the same with the exception of the filename xxx.sgm and the bean id.
    I very much appreciate your help. Thanks!
    null

    Hello Paulo,
    thank you for your answer, but i'm using type 04 XML for SEPA.
    when i select Type XML, the fields "output to file system" and "filename" are hidden.
    i dont understand why ...

  • Formating output of a query for tracing

    Hi,
    This is for 10.2.0.4 on IBM AIX 6.1
    I need to generate traces for some sessions by setting the event 10046. I want to generate an SQL script for doing this which will be as follows.
    SQL> oradebug setorapid 20
    SQL> oradebug unlimit
    SQL> oradebug Event 10046 trace name context forever, level 12
    SQL> oradebug setorapid 100
    SQL> oradebug unlimit
    SQL> oradebug Event 10046 trace name context forever, level 12
    SQL> oradebug setorapid 210
    SQL> oradebug unlimit
    SQL> oradebug Event 10046 trace name context forever, level 12 In this example, you see only three sessions but actually i have a lot of session and that is why i need to have a script.
    I have following query which i can use to get the PID of a session which i would be tracing.
    select a.pid
    from v$process a, v$session b
    where a.addr=b.paddr and a.username is not null ;Can anyone help to tell me how to generate a script for doing this. I tried to do following but formatting is not correct. I want above three trace commands in a sequence for every PID in my script.
    select
    'oradebug setorapid '||b.pid||'                                   '||
    'oradebug unlimit                                                 '||
    'oradebug Event 10046 trace name context forever, level 12        '||
    'oradebug tracefile_name                                          '
    from v$session a, v$process b where a.username is not null and a.paddr=b.addr order by b.spid;Salman

    Hi, Salman,
    You're writing one line of output per file.
    If you want to write 4 lines per file, add newline characters (CHR(10) on my system; may be different on yours) between the lines, like this:
    select    'oradebug setorapid ' || p.pid                     || CHR (10) ||
           'oradebug unlimit'                              || CHR (10) ||
           'oradebug Event 10046 trace name context forever, level 12'     || CHR (10) ||
           'oradebug tracefile_name                                          '
    from        v$session      s,
           v$process      p
    where        s.username      is not null
    and        s.paddr     = p.addr
    order by  p.spid;Why use meaningless table aliases like a and b?
    Why not use something that reminds you which table is which, and helps prevent mistakes; something like p for v$process and s for v$session?

  • SQL Developer formatted output

    Hello,
    Could you please help me in getting the formatted output on Oracle sql developer tool, I am not able to find andy options to set
    I have copy paste the result from this tool to excel, I am getting plain text out put, I have more columns and readablity is not there
    Regards,
    Neil
    Edited by: NeilCSE on Apr 6, 2010 6:01 AM

    Hi,
    try this.
    I am on windows
    SQL> spool c:\emp_text.txt;
    Started spooling to c:\emp_text.txt
    SQL> select ename||'|'||empno from emp;
    ENAME||'|'||EMPNO
    JAMES|7900
    FORD|7902
    MILLER|7934
    SMITH|7369
    ALLEN|7499
    WARD|7521
    JONES|7566
    MARTIN|7654
    BLAKE|7698
    CLARK|7782
    SCOTT|7788
    KING|7839
    TURNER|7844
    ADAMS|7876
    14 rows selected
    SQL> spool off;
    Stopped spooling to c:\emp_text.txtThen open in excel as delimeted by |
    Regards,
    Bhushan

  • Always the excel format output

    I have a requirement in which i wish to output the file always in excel format.
    i have made a selection screen field with search help,if the user deletes the default path given in this text box,replaces it with any free text and puts no extension or any extension other than excel,i want function that will ask him to either enter .xls extension or use search help or press f4.
    how can i achieve this.this  iwish to do error handling to avoid the file getting generated with faulty file.
    please reply.

    Hi,
    Data : lv_file type string.
    checking the filetype the user has entenred.
    find : '.xls' in p_file.
    if sy-subrc ne 0 .
    split at '.' into another variable.
    concatenate that with '.xls' into lv_file.
    else.
    do nothing.
    endif.
    With Regards,
    Sumodh.P

Maybe you are looking for