Spool file with .txt extension


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Spool file with .txt extension
# 1  
Old 09-22-2009
Spool file with .txt extension

Hi


I am logging into sql using script.

Code:
sqlplus ima/ima@test <<!
spool /opt/tt/spoolfile.txt
@sql.sql
spool off

.

now i am getting a spool file named spoolfile.txt.lst

i want it to be only spoolfile.txt

I am working on solaris

Please help

Last edited by radoulov; 09-22-2009 at 09:22 AM.. Reason: please use code tags
# 2  
Old 09-22-2009
To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

---------- Post updated at 02:26 PM ---------- Previous update was at 02:22 PM ----------

Are you sure the character in the spool filename is really a dot?
Could you post the exact content of your scripts (shell and sql)?
# 3  
Old 09-22-2009
Code:
 sqlplus mqad/mqad@testeb2 <<!
column dt new_val X
select to_char(sysdate,'YYYY-MM-DD-HH-MI-SS') dt from dual;
spool /export/home/scripts/eb2/aqad/prd2/data/PRD2_MQAD_&X.txt
@/export/home/scripts/eb2/comm/sqlq.sql
spool off



And sql script contains just one line desc emptable.
# 4  
Old 09-22-2009
Change:

Code:
PRD2_MQAD_&X.txt


to:

Code:
PRD2_MQAD_&X..txt

# 5  
Old 09-22-2009
Thanks it worked....Smilie


one more thing i am geting @/export/home/scripts/eb2/comm/sqlq.sql

as the first line in the spool file... any way to remove it.
# 6  
Old 09-22-2009
Code:
sqlplus -s
(Silent)

# 7  
Old 09-22-2009
Quote:
Originally Posted by ankurk
Thanks it worked....Smilie


one more thing i am geting @/export/home/scripts/eb2/comm/sqlq.sql

as the first line in the spool file... any way to remove it.
Put the statement directly in the here document or move the spool inside the sql script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Desired output.txt for reading txt file using awk?

Dear all, I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script. Any help is greatly appreciated. Greetings, emily DATA.txt (snippet of the huge text file) 407202849... (2 Replies)
Discussion started by: emily
2 Replies

2. Windows & DOS: Issues & Discussions

2 Questions: replace text in txt file, add text to end of txt file

so... Lets assume I have a text file. The text file contains multiple "#" symbols. I want to replace all thos "#"s with a STRING using DOS/Batch I want to add a certain TEXT to the end of each line. How can I do this WITHOUT aid of sed, grep or anything linux related ? (1 Reply)
Discussion started by: pasc
1 Replies

3. Shell Programming and Scripting

Need to append the date | abcddate.txt to the first line of my txt file

I want to add/append the info in the following format to my.txt file. 20130702|abcd20130702.txt FN|SN|DOB I tried the below script but it throws me some exceptions. <#!/bin/sh dt = date '+%y%m%d'members; echo $dt+|+members+$dt; /usr/bin/awk -f BEGIN { FS="|"; OFS="|"; } { print... (6 Replies)
Discussion started by: harik1982
6 Replies

4. Shell Programming and Scripting

[Solved] Giving files .txt extension

Hi there, I have around 145,000 files with no file extension in this directory - /home/adams/29: The file name varies but all end with a number from 0 - 9, e.g. TTFILE_BAT_235496, CCNHATA_RFC_23455 I want to give all these 145,000 .txt extension. Please how do I do that? Thanks (2 Replies)
Discussion started by: Creems
2 Replies

5. Shell Programming and Scripting

awk append fileA.txt to growing file B.txt

This is appending a column. My question is fairly simple. I have a program generating data in a form like so: 1 20 2 22 3 23 4 12 5 43 For ever iteration I'm generating this data. I have the basic idea with cut -f 2 fileA.txt | paste -d >> FileB.txt ???? I want FileB.txt to grow, and... (4 Replies)
Discussion started by: theawknewbie
4 Replies

6. Homework & Coursework Questions

how to change this looking for mimetype "text/plain" instead of extension *.txt?

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Create a Shell script that looks for all text files in your home directory (including subdirectories). List... (3 Replies)
Discussion started by: rollinator
3 Replies

7. UNIX for Dummies Questions & Answers

rusty with cp command -- how to cp all .doc files with .txt extension

I'm rusty with cp, so I was wondering: is it possible to cp all the .doc files in a folder and make them .txt files? Can you use cp to do that? (3 Replies)
Discussion started by: Straitsfan
3 Replies

8. Shell Programming and Scripting

Checking if the files in a directory have a txt extension

foreach file ($dir1/*) if ($file ~ *.txt) then echo "Skipping $file (is a txt file)" endif end that should work right guys? :confused: (15 Replies)
Discussion started by: pantelis
15 Replies

9. Shell Programming and Scripting

command to list .txt and .TXT file

Hi expersts, in my directory i have *.txt and *.TXT and *.TXT.log, *.txt.log I want list only .txt and .TXT files in one command... how to ?? //purple (1 Reply)
Discussion started by: thepurple
1 Replies

10. UNIX for Dummies Questions & Answers

Binary txt file received when i use uuencode to send txt file as attachment

Hi, I have already read a lot of posts on sending attachments in unix...but none of them were of help for my problem...so here goes.. i wanna attach a text file and send to a mail id..used the following code : uuencode "$File1" "$File1" ;|mail -s "$Mail_sub" abc@abc.com it works... (2 Replies)
Discussion started by: ash22
2 Replies
Login or Register to Ask a Question