Formatting output to text file
Hi,
I need some help with formatting the output to a file. Is there a way we can change the size or font of the text written to a text file?
Also can we set the line length (for eg. 80 characters).
I want to ouput description and amount king of stuff how do i achieve uniformity in the output.
I am using FileWriter or BufferedWriter to write the contents of the file.
The output i am looking for is in the following format
Desciprtion Amount
1.XXXXXXXXXXXXX $nn,nnn.nn
2.XXXXX $nn,nnn.nn
Thanks
vir
Is there a way we can change the size or font of the
text written to a text file?Not before you define "text file"... For me a text file means a file that consists of mostly text (=letters and numbers). If the text should contain formatting like font size it doesn't really fit in this category anymore.
You can write as many characters per line as you want.
The format
1.XXXXXXXXXXXXX $nn,nnn.nn
2.XXXXX $nn,nnn.nn
is easily achieved - line number, period, text, space, and a formatted number. Something like
1. XXXXXXXXXXXXX $nn,nnn.nn
2. XXXXX $nn,nnn.nn
is a lot more trickier unless you know how long the description can be in maximum.
Similar Messages
-
Hi
I have two master & detailed table for eg emp,dept.
I need my output in text file with delimiter ~ in the below format.
10~accounting~newyork
7782~CLARK~MANAGER~7839~6/9/1981~2450.00~10
7839~KING~PRESIDENT~11/17/1981~5000.00~10
7934~MILLER~CLERK~7782~1/23/1982~1300.00~10Rgds
Vkwell, go for it! Don't let us stop you ;)
SQL> set colsep '~'
SQL> select *
2 from emp
3 /
EMPNO~ENAME ~JOB ~ MGR~HIREDATE ~ SAL~ COMM~ DEPTNO
----------~----------~---------~----------~---------~----------~----------~----------
7369~SMITH ~CLERK ~ 7902~17-DEC-80~ 800~ ~ 20
7499~ALLEN ~SALESMAN ~ 7698~20-FEB-81~ 1600~ 300~ 30
7521~WARD ~SALESMAN ~ 7698~22-FEB-81~ 1250~ 500~ 30
7566~JONES ~MANAGER ~ 7839~02-APR-81~ 2975~ ~ 20
7654~MARTIN ~SALESMAN ~ 7698~28-SEP-81~ 1250~ 1400~ 30
7698~BLAKE ~MANAGER ~ 7839~01-MAY-81~ 2850~ ~ 30
7782~CLARK ~MANAGER ~ 7934~09-JUN-81~ 2450~ ~ 10
7788~SCOTT ~ANALYST ~ 7566~19-APR-87~ 3000~ ~ 20
7839~KING ~PRESIDENT~ ~17-NOV-81~ 5000~ ~ 10
7844~TURNER ~SALESMAN ~ 7698~08-SEP-81~ 1500~ 0~ 30
7876~ADAMS ~CLERK ~ 7788~23-MAY-87~ 1100~ ~ 20
7900~JAMES ~CLERK ~ 7698~03-DEC-81~ 950~ ~ 30
7902~FORD ~ANALYST ~ 7566~03-DEC-81~ 3000~ ~ 20
7934~MILLER ~CLERK ~ 7782~23-JAN-82~ 1300~ ~ 10
14 rows selected. -
Converting Excel Output to Text File (Text(MS-DOS)) in oracle 6i
I have been able to save Excel Output to Text File (.txt) using OLE. However, I need to save it as TEXT(MS-DOS) specifically due to certain formatting issues.
Kindly suggest some solution.
I need it very urgently.
Thanks!Hello Sandy,
does this mean that you created an Excel file using OLE and named it *.txt?
And what do you mean by saving as TEXT(MS-DOS)? A csv file?
Regards
Marcus -
How to list the contents of an OSX directory, and output to text file?
hello there any hints with any known program that does following
I have recorded my music directory to DVD and now i would like to make an .txt file what the dvd contains...cos its way of hand to write all 100xx files by hand...
How to list the contents of an OSX directory, and output to text file?
any prog that does that? any hints?
best regardsThis script makes a hierarchical file listing all files in a folder and subfolder:
Click here to launch Script Editor.
choose folder with prompt "Choose a folder to process..." returning theFolder
set theName to name of (info for theFolder)
set thepath to quoted form of POSIX path of theFolder
set currentIndex to theFolder as string
do shell script "ls -R " & thepath returning theDir
set theDirList to every paragraph of theDir
set newList to {"Contents of folder \"" & theName & "\"" & return & thepath & return & return}
set theFilePrefix to ""
repeat with i from 1 to count of theDirList
set theLine to item i of theDirList
set my text item delimiters to "/"
set theMarker to count of text items of thepath
set theCount to count of text items of theLine
set currentFolder to text item -1 of theLine
set theFolderPrefix to ""
if theCount is greater than theMarker then
set theNestIndex to theCount - theMarker
set theTally to -1
set theFilePrefix to ""
set theSuffix to ""
repeat theNestIndex times
set theFolderPrefix to theFolderPrefix & tab
set theFilePrefix to theFilePrefix & tab
if theTally is -1 then
set theSuffix to text item theTally of theLine & theSuffix
else
set theSuffix to text item theTally of theLine & ":" & theSuffix
end if
set currentIndex to "" & theFolder & theSuffix
set theTally to theTally - 1
end repeat
end if
set my text item delimiters to ""
if theLine is not "" then
if word 1 of theLine is "Volumes" then
set end of newList to theFolderPrefix & "Folder: > " & currentFolder & return
else
try
if not folder of (info for alias (currentIndex & theLine & ":")) then
set end of newList to theFilePrefix & tab & tab & tab & "> " & theLine & return
end if
end try
end if
end if
end repeat
open for access file ((path to desktop as string) & "Contents of folder- " & theName & ".txt") ¬
with write permission returning theFile
write (newList as string) to theFile
close access theFile -
Query SQL and output to text file then loop through list to execute
It seems there's no obvious way to do what I want to below as everyone has their own take on querying SQL server with Powershell!
I need to use PowerShell to connect to ServerA and query a test database and select Name from it. The Name results of that query need to output to C:\names.txt and then I need a ForEach loop to go through that file line by line and execute some text
against each Name from the list.
Any ideas how I can achieve this?
Thanks!I can't even output SQl to a table at the moment, the text file has a column header and about 50 empty rows in the file.
$dataSource = "DEMO"
$database = "TESTDB"
$connectionString = "Server=$dataSource;uid=$user; pwd=$pwd;Database=$database;Integrated Security=True;"
$query = "SELECT name FROM dbo.names"
$connection = New-Object System.Data.SqlClient.SqlConnection
$connection.ConnectionString = $connectionString
$connection.Open()
$command = $connection.CreateCommand()
$command.CommandText = $query
$result = $command.ExecuteReader()
$table = new-object "System.Data.DataTable"
$table.Load($result)
$format = @{Expression={$_.Id};Label="Name";width=25}
$table | format-table $format | Out-File C:\export\servers.txt
$connection.Close() -
Junk Characters in Report Output(While redirecting the output to text file)
While generating the report (Reports 9i) output to a text file, I get the report output that contains junk characters. The other output formats viz. pdf, rtf have no problem.
Please share how to correct it.
Thanks.Yes, the MODE is set to Character and DESFORMAT is set to DFLT.
Still the problem exists.
Any idea please? -
Smartform/Sap script output to Text file/PDF/WORD
Hi,
I need to download/transfer the output of smartforms/sap script to text file/pdf file or word file.How do i do that?
Do I need to create a new output device?
thnx in advance
chirantanHi,
Go through the following Code
Mail a sapscript
SAPscript: Autotmatically e-mail as PDF
How to convert sapscript(Purchage order) inot pdf format & send in mail
Check the following Code
REPORT ZRICH_0003.
DATA: ITCPO LIKE ITCPO,
TAB_LINES LIKE SY-TABIX.
Variables for EMAIL functionality
DATA: MAILDATA LIKE SODOCCHGI1.
DATA: MAILPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: MAILHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: MAILBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: MAILTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: MAILREC LIKE SOMLREC90 OCCURS 0 WITH HEADER LINE.
DATA: SOLISTI1 LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
PERFORM SEND_FORM_VIA_EMAIL.
FORM SEND_FORM_VIA_EMAIL *
FORM SEND_FORM_VIA_EMAIL.
CLEAR: MAILDATA, MAILTXT, MAILBIN, MAILPACK, MAILHEAD, MAILREC.
REFRESH: MAILTXT, MAILBIN, MAILPACK, MAILHEAD, MAILREC.
Creation of the document to be sent File Name
MAILDATA-OBJ_NAME = 'TEST'.
Mail Subject
MAILDATA-OBJ_DESCR = 'Subject'.
Mail Contents
MAILTXT-LINE = 'Here is your file'.
APPEND MAILTXT.
Prepare Packing List
PERFORM PREPARE_PACKING_LIST.
Set recipient - email address here!!!
MAILREC-RECEIVER = '[email protected]'.
MAILREC-REC_TYPE = 'U'.
APPEND MAILREC.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = MAILDATA
PUT_IN_OUTBOX = ' '
TABLES
PACKING_LIST = MAILPACK
OBJECT_HEADER = MAILHEAD
CONTENTS_BIN = MAILBIN
CONTENTS_TXT = MAILTXT
RECEIVERS = MAILREC
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
ENDFORM.
Form PREPARE_PACKING_LIST
FORM PREPARE_PACKING_LIST.
CLEAR: MAILPACK, MAILBIN, MAILHEAD.
REFRESH: MAILPACK, MAILBIN, MAILHEAD.
DESCRIBE TABLE MAILTXT LINES TAB_LINES.
READ TABLE MAILTXT INDEX TAB_LINES.
MAILDATA-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( MAILTXT ).
Creation of the entry for the compressed document
CLEAR MAILPACK-TRANSF_BIN.
MAILPACK-HEAD_START = 1.
MAILPACK-HEAD_NUM = 0.
MAILPACK-BODY_START = 1.
MAILPACK-BODY_NUM = TAB_LINES.
MAILPACK-DOC_TYPE = 'RAW'.
APPEND MAILPACK.
Creation of the document attachment
This form gets the OTF code from the SAPscript form.
If you already have your OTF code, I believe that you may
be able to skip this form. just do the following code, looping thru
your SOLISTI1 and updating MAILBIN.
PERFORM GET_OTF_CODE.
LOOP AT SOLISTI1.
MOVE-CORRESPONDING SOLISTI1 TO MAILBIN.
APPEND MAILBIN.
ENDLOOP.
DESCRIBE TABLE MAILBIN LINES TAB_LINES.
MAILHEAD = 'TEST.OTF'.
APPEND MAILHEAD.
Creation of the entry for the compressed attachment
MAILPACK-TRANSF_BIN = 'X'.
MAILPACK-HEAD_START = 1.
MAILPACK-HEAD_NUM = 1.
MAILPACK-BODY_START = 1.
MAILPACK-BODY_NUM = TAB_LINES.
MAILPACK-DOC_TYPE = 'OTF'.
MAILPACK-OBJ_NAME = 'TEST'.
MAILPACK-OBJ_DESCR = 'Subject'.
MAILPACK-DOC_SIZE = TAB_LINES * 255.
APPEND MAILPACK.
ENDFORM.
Form GET_OTF_CODE
FORM GET_OTF_CODE.
DATA: BEGIN OF OTF OCCURS 0.
INCLUDE STRUCTURE ITCOO .
DATA: END OF OTF.
DATA: ITCPO LIKE ITCPO.
DATA: ITCPP LIKE ITCPP.
CLEAR ITCPO.
ITCPO-TDGETOTF = 'X'.
Start writing OTF code
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZTEST_FORM'
LANGUAGE = SY-LANGU
OPTIONS = ITCPO
DIALOG = ' '
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'START_FORM'
EXCEPTIONS
ERROR_MESSAGE = 01
OTHERS = 02.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
WINDOW = 'MAIN'
EXCEPTIONS
ERROR_MESSAGE = 01
OTHERS = 02.
Close up Form and get OTF code
CALL FUNCTION 'END_FORM'
EXCEPTIONS
ERROR_MESSAGE = 01
OTHERS = 02.
MOVE-CORRESPONDING ITCPO TO ITCPP.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = ITCPP
TABLES
OTFDATA = OTF
EXCEPTIONS
OTHERS = 1.
Move OTF code to structure SOLI form email
CLEAR SOLISTI1. REFRESH SOLISTI1.
LOOP AT OTF.
SOLISTI1-LINE = OTF.
APPEND SOLISTI1.
ENDLOOP.
ENDFORM.
Regards
Sreeni -
Create and write form output to text file
HI am pretty new to this and have a prob.
I have 10 fields in my form submitting which i need to create and write the form field values into an xml fil..this file is further used for other read write transactions.
Can somebody help creating and writing data into the text file with code (if u have it handy).
Thanks for the help in anticipationFile f = new File("/path/to/output.txt");
BufferedWriter bw = new BufferedWriter(new FileWriter(f));
String inputData = null;
while(true){
inputData = //whatever data you need
bw.write(inputData);
bw.flush();
bw.close();
f.close;
// All this should be in a try{}catch(IOException ioe){} -
How to generate complete file list of hard drive and output to text file
I need to start backing things up to drives, which over time will be put in storage.
I would like to be able to create a complete file index and folder tree of every drive and have it output to a text file so that in the event I ever need to go back to a drive, I can search the text file to know what drive to pull from storage (rather than using spotlight to search through 25 drives).
Is there any way to do this with either OS X or with a third party software? Ideally, text file and not PDF.
Thanks!You can use the terminal.app with the following command:
rsync -rlptn --stats --progress +Source.. Destination..+
example with actual output:
rsync -rlptn --stats --progress /Volumes/Mac\ Data/websites /Volumes/EXT\ SATA2building file list ...
146 files to consider
websites/
websites/.DS_Store
websites/bestelectricbill.com/
websites/bestelectricbill.com/.DS_Store
websites/bestelectricbill.com/211299c1
websites/bestelectricbill.com/awards.php
websites/bestelectricbill.com/careers.php
websites/bestelectricbill.com/category1.php
websites/bestelectricbill.com/category2.php
websites/bestelectricbill.com/category3.php
websites/bestelectricbill.com/checkout.php
websites/bestelectricbill.com/company.php
websites/bestelectricbill.com/contactus.php
websites/bestelectricbill.com/email.js
websites/bestelectricbill.com/faqs.php
websites/bestelectricbill.com/fsp.js
websites/bestelectricbill.com/history.php
websites/bestelectricbill.com/index.php
websites/bestelectricbill.com/index_copy.php
websites/bestelectricbill.com/investors.php
websites/bestelectricbill.com/job1.php
websites/bestelectricbill.com/job2.php
websites/bestelectricbill.com/job3.php
websites/bestelectricbill.com/job4.php
websites/bestelectricbill.com/job5.php
websites/bestelectricbill.com/managementteam.php
websites/bestelectricbill.com/news1.php
websites/bestelectricbill.com/news2.php
websites/bestelectricbill.com/news3.php
websites/bestelectricbill.com/news4.php
websites/bestelectricbill.com/news5.php
websites/bestelectricbill.com/newsandevents.php
websites/bestelectricbill.com/partners.php
websites/bestelectricbill.com/press.php
websites/bestelectricbill.com/privacypolicy.php
websites/bestelectricbill.com/product1a.php
websites/bestelectricbill.com/product1a1.php
websites/bestelectricbill.com/product1a2.php
websites/bestelectricbill.com/product1b.php
websites/bestelectricbill.com/product1b1.php
websites/bestelectricbill.com/product1b2.php
websites/bestelectricbill.com/product1c.php
websites/bestelectricbill.com/product1c1.php
websites/bestelectricbill.com/product1c2.php
websites/bestelectricbill.com/product1d.php
websites/bestelectricbill.com/product1d1.php
websites/bestelectricbill.com/product1d2.php
websites/bestelectricbill.com/product1e.php
websites/bestelectricbill.com/product1e1.php
websites/bestelectricbill.com/product1e2.php
websites/bestelectricbill.com/products.php
websites/bestelectricbill.com/productsearch.php
websites/bestelectricbill.com/registration.php
websites/bestelectricbill.com/search.php
websites/bestelectricbill.com/searchresults.php
websites/bestelectricbill.com/service1.php
websites/bestelectricbill.com/service1a.php
websites/bestelectricbill.com/service1a1.php
websites/bestelectricbill.com/service1a2.php
websites/bestelectricbill.com/service1b.php
websites/bestelectricbill.com/service1b1.php
websites/bestelectricbill.com/service1b2.php
websites/bestelectricbill.com/service1c.php
websites/bestelectricbill.com/service1c1.php
websites/bestelectricbill.com/service1c2.php
websites/bestelectricbill.com/service1d.php
websites/bestelectricbill.com/service1d1.php
websites/bestelectricbill.com/service1d2.php
websites/bestelectricbill.com/service1e.php
websites/bestelectricbill.com/service1e1.php
websites/bestelectricbill.com/service1e2.php
websites/bestelectricbill.com/service2.php
websites/bestelectricbill.com/service3.php
websites/bestelectricbill.com/services.php
websites/bestelectricbill.com/shoppingcart.php
websites/bestelectricbill.com/sitemap.php
websites/bestelectricbill.com/story1.php
websites/bestelectricbill.com/story2.php
websites/bestelectricbill.com/story3.php
websites/bestelectricbill.com/termsofuse.php
websites/bestelectricbill.com/Templates/
websites/bestelectricbill.com/Templates/siteassist_config.cfg
websites/bestelectricbill.com/Templates/siteassist_template.dwt.php
websites/bestelectricbill.com/Templates/_notes/
websites/bestelectricbill.com/Templates/_notes/dwsync.xml
websites/bestelectricbill.com/_notes/
websites/bestelectricbill.com/_notes/dwsync.xml
websites/bestelectricbill.com/images/
websites/bestelectricbill.com/images/.DS_Store
websites/bestelectricbill.com/images/app_img17.jpg
websites/bestelectricbill.com/images/bestelectriclogo.jpg
websites/bestelectricbill.com/images/bestelectriclogo.jpg.ori.jpg
websites/bestelectricbill.com/images/btn_saveBusiness.jpg
websites/bestelectricbill.com/images/btn_saveHome.jpg
websites/bestelectricbill.com/images/imgAbout_OverviewTeam copy.jpg
websites/bestelectricbill.com/images/imgCollage.jpg
websites/bestelectricbill.com/images/imgComp1.jpg
websites/bestelectricbill.com/images/imgComp3.jpg
websites/bestelectricbill.com/images/imgComp4.jpg
websites/bestelectricbill.com/images/imgComp5.jpg
websites/bestelectricbill.com/images/imgComp6.jpg
websites/bestelectricbill.com/images/imgComp7.jpg
websites/bestelectricbill.com/images/imgComp8.jpg
websites/bestelectricbill.com/images/phone number.jpg
websites/bestelectricbill.com/images/phone number2.jpg
websites/bestelectricbill.com/images/_notes/
websites/bestelectricbill.com/images/_notes/dwsync.xml
websites/bestelectricbill.com/siteassist_css/
websites/bestelectricbill.com/siteassist_css/color.css
websites/bestelectricbill.com/siteassistcss/mystyles.css
websites/bestelectricbill.com/siteassist_css/navigation.css
websites/bestelectricbill.com/siteassistcss/navigationcolor.css
websites/bestelectricbill.com/siteassist_css/style.css
websites/bestelectricbill.com/siteassist_css/template.css
websites/bestelectricbill.com/siteassistcss/notes/
websites/bestelectricbill.com/siteassistcss/notes/dwsync.xml
websites/bestelectricbill.com/siteassist_images/
websites/bestelectricbill.com/siteassistimages/above_topnavbackground.jpg
websites/bestelectricbill.com/siteassistimages/below_topnavbackground.jpg
websites/bestelectricbill.com/siteassist_images/border.gif
websites/bestelectricbill.com/siteassistimages/bottombackground.jpg
websites/bestelectricbill.com/siteassistimages/brcorner.jpg
websites/bestelectricbill.com/siteassist_images/bubbles.jpg
websites/bestelectricbill.com/siteassistimages/dottedhorizontal.jpg
websites/bestelectricbill.com/siteassistimages/dottedvertical.jpg
websites/bestelectricbill.com/siteassistimages/home_mainbackground.jpg
websites/bestelectricbill.com/siteassistimages/img100x125.gif
websites/bestelectricbill.com/siteassistimages/img160x110.gif
websites/bestelectricbill.com/siteassistimages/img400x197.gif
websites/bestelectricbill.com/siteassistimages/img463x170.gif
websites/bestelectricbill.com/siteassistimages/loginbtn.gif
websites/bestelectricbill.com/siteassistimages/logotraditional.jpg
websites/bestelectricbill.com/siteassistimages/mainfeature.jpg
websites/bestelectricbill.com/siteassistimages/side_navcell.gif
websites/bestelectricbill.com/siteassistimages/side_nav_cellsel.gif
websites/bestelectricbill.com/siteassistimages/side_nav_opengrad.gif
websites/bestelectricbill.com/siteassistimages/side_nav_open_selgrad.gif
websites/bestelectricbill.com/siteassistimages/sidenavbackground.jpg
websites/bestelectricbill.com/siteassist_images/spacer.gif
websites/bestelectricbill.com/siteassistimages/topbackground.jpg
websites/bestelectricbill.com/siteassistimages/topnavbackground.jpg
websites/bestelectricbill.com/siteassistimages/topnav_cellbg.gif
websites/bestelectricbill.com/siteassistimages/topnav_cell_bghover.gif
websites/bestelectricbill.com/siteassistimages/trcorner.jpg
websites/bestelectricbill.com/siteassistimages/notes/
websites/bestelectricbill.com/siteassistimages/notes/dwsync.xml
Number of files: 146
Number of files transferred: 135
Total file size: 1150921 bytes
Total transferred file size: 1150921 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 2825
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 3717
Total bytes received: 896
sent 3717 bytes received 896 bytes 9226.00 bytes/sec
total size is 1150921 speedup is 249.50
Simply copy and and paste output text in terminal to a text file.
What I actually did there was use the "dry run option" (-n) - no files were actually transferred.
For more info on the rsync command type and run "man rsync" at the terminal command line.
Also see this webpage:
http://www.ss64.com/osx/rsync.html
Kj -
HELP ON HOW TO STORE OUTPUT IN TEXT FILE
Hello,
I am trying to output the results from queties into an output text file does anyone knows how to do that please?
For example i want to do :
Select SYSDATE from dual;
and output the result of it in a text file called output.txt does anyone knows how to do that please?
THanks a lot and every help is appreciated.
Regards,
giannisCan i set the path of the output file Yes, you can :
TEST@db102 SQL> spool /tmp/output.txt
TEST@db102 SQL> select sysdate from dual;
SYSDATE
14-JUN-06
TEST@db102 SQL> spool off
TEST@db102 SQL> !ls -ltr /tmp | tail -n 1
-rw-r--r-- 1 ora102 dba 313 Jun 14 01:52 output.txt
TEST@db102 SQL> !cat /tmp/output.txt
TEST@db102 SQL> select sysdate from dual;
SYSDATE
14-JUN-06
TEST@db102 SQL> spool off
TEST@db102 SQL> -
How to redirect CELLCLI output to text file
Hi,
I would like to redicrect the output of the cellcli command to a text file .
For example , how to redirect the output of this command to a text file on /tmp
CellCLI> list metrichistory where objectType = 'CELL' -
and name = 'CL_TEMP'Thankscellcli has spooling capabilities similar to sqlplus:
CellCLI> help spool
Usage: SPO[OL] [<filename> [ CRE[ATE] | REP[LACE] | APP[END]] | OFF ]
Purpose: SPOOL <filename>: Direct the results to the file <filename>.
SPOOL OFF: Turn off the spooling.
SPOOL: Check the current spooling status.
Arguments:
<filename>: The filename where the results will be output.
Options:
[APPEND]: If the filename already exists, the following output will
be appended to the file. Without this option, the existing file
contents will be replaced.
[CREATE]: If the filename already exists, an error is reported.
[REPLACE]: If the filename already exists, the contents will be
replaced. This is the default, when no option is provided.
Examples:
spool myfile
spool myfile append
spool off
spoolBut if you are trying to script it, it would be easier to just run it command line:
# cellcli -e "list metrichistory where objectType = 'CELL' and name = 'CL_TEMP'" > /tmp/CL_TEMP.txtAlso look into dcli which allows you to run cellcli commands on one or more cells from a compute node.
Good luck. -
Does anyone know how to output to a text file.
I've got a ticket machine and when a button is pressed at the final step i want it to output a boolean variable to a text file, preferably to the desktop
this is a simple .swf which i have created.ok so i'm a bit new to flash, any help would be much appreciated as i've never used the save method.
i've got the boolean variable: flag,
and i want to output it's value to a text file when i press the taketheticket button:
this is was i have so far
function taketheticket(event:MouseEvent):void
trace("the change is " + flag);
gotoAndStop(8); -
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 ? -
Spooling queries output to text file
Hi All,
I need help to spool the output to a text file for a sequence of queries that I need to execute.
Lets say, the queries would in a sql file as follows:
Select * from emp where empId = 1
Select * from emp where empId = 2
Select * from emp where empId = 3
The output in txt file should have the details as
Employee Id Employee Name Employee Designation
1 Alex Manager
2 Conrad Sr Manager
3 Herman Technical architect.
I am trying to execute this from sql developer.
Any pointers in this regard would be highly helpful.Hi,
Welcome to the forum!
Why not use just one query
SELECT *
FROM enp
WHERE empid IN (1, 2, 3)
ORDER BY empid
You can use "SPOOL filename APPEND" to re-open and add to an existing spool file after it has been closed, but there's no need to in this case. -
I have an MDX query embedded in a MaxL script. I want the query to output to a text file on my Unix server. I have tried using the MaxL spool command, but it outputs STDOUT, not just the output from the MDX. I want the MDX results set and only the MDX results set in a separate text file. There has got to be a way to do this, right? I'm trying to use MDX instead of a report script for extracting data from one essbase cube and loading it into another.<BR><BR>Any help is appreciated,<BR><BR>James
ok so i'm a bit new to flash, any help would be much appreciated as i've never used the save method.
i've got the boolean variable: flag,
and i want to output it's value to a text file when i press the taketheticket button:
this is was i have so far
function taketheticket(event:MouseEvent):void
trace("the change is " + flag);
gotoAndStop(8);
Maybe you are looking for
-
Filter(NULL IS NOT NULL) in Explain Plan ??
Hi All, Can someone please explain what this explain plan statement means? I see a filter(NULL IS NOT NULL) as the first statement - could not figure out why it came up so from googling. My Query Used: EXPLAIN PLAN FOR MERGE INTO summary_bysrccd USIN
-
How to use TABLE_FROM_BLOCK in forms 10g ??????
i have use the procedure below code in when-validate of a database item in forms6i its working fine ,but the same form i have compiled in forms10g and then when the when validate is fired it gives following error frm-40933 Cannot populate table becau
-
Can some one provide me the basic steps/ code to get a message when there are no transactions when a custom gl report is run. I need the date Header message saying there are no documents. Thanks Krishna
-
How do I extract and combine documents?
How do I extract and combine documents?
-
whats the command in a layer 3 switch to shift from router to switch function and vice versa? In a VTP, if server is the default settings, is VTP working even though no client was configured?