Spool issue in unix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Spool issue in unix
# 1  
Old 07-30-2012
Error Spool issue in unix

Hi Friends,

I am trying to spool the data from Teradata. The rpoblem which i am facing is , the coulmn data is appended with ".(dot)" for some coulmns. Please find the below data :

data i want in file :

Code:
1|BANG|KINR|3456
2|KIBNJ|UIE|6347
3|JEEM|Y34E|3874

data which is spooling in to the file :

Code:
 
1|BANG|KINR|3456.
2|KIBNJ|UIE.|6347
3.|JEEM|Y34E|3874

Please Help .. i tried trim option on the columns but no hope. Smilie

Last edited by Scott; 07-31-2012 at 05:59 AM.. Reason: Code tags
# 2  
Old 07-30-2012
How are you spooling the data into File... Do you want to remove the "." in the every occurence of the file...

---------- Post updated at 01:27 AM ---------- Previous update was at 01:21 AM ----------

You are excepting this one
Code:
 sed -e 's/[.]//g' test.txt

# 3  
Old 07-30-2012
Hi Bmk, Thanks for the reply. I would not say that i should remove all the occurence of . in a file. But i need to remove all the "." from the end of each column value .

For example i may get the value like

Code:
1234.5678

in the above case i should not remove the ".".

I should remove only the "." only at the end of the each coulumn value

Sample data :

Code:
1|HJKDEH|783.3748.|ewhjh.
2.|hjhDKJ.|1234.567|HEUY

I should remove "." from the each coulumn value delimited by "|"

Plz help ...Thanks in advance.

Last edited by Scott; 07-31-2012 at 05:59 AM.. Reason: Code tags
# 4  
Old 07-30-2012
Code:
perl -pe 's/\.(?=[|\s])//g' test.txt

This User Gave Thanks to balajesuri For This Post:
# 5  
Old 07-30-2012
You are excepting this one...

Code:
tr -d '.' < test.txt

This User Gave Thanks to bmk For This Post:
# 6  
Old 07-31-2012
@bala : Thanks for the reply Smilie Can you please explain the above code, it will be more helpful to me as i am new to Shell. Smilie
# 7  
Old 07-31-2012
Code:
perl -pe '   => The perl language; Execute perl code and print all statements by default
s/           => Substitute
\.(?=[|\s])  => dot that is followed by either a pipe or a whitespace character (' ', '\t', '\n')
//           => with nothing
g            => and do this globally
' test.txt   => File on which perl has to operate

This User Gave Thanks to balajesuri For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

DNS server /var/spool issue

Hello all Currently I am working in a live production environment with 100+ Solaris servers . The environment has one DNS server and one SMTP server. The problem that I am facing since the past 2 months is that the /var/spool/mqueue on my DNS server keeps getting full i.e. mails with name... (1 Reply)
Discussion started by: Junaid Subhani
1 Replies

2. Solaris

/var/spool/mqueue issue

Hi guys . I have a solaris machine serving as a DNS server for my environment. Everytime I go into /var/spool/mqueue , there are an aweful lot of emails with names likes: qfqB6ChrpL006644. When I cat the file , I get the following output: H??Received: from machine.domain.com... (3 Replies)
Discussion started by: Junaid Subhani
3 Replies

3. UNIX for Dummies Questions & Answers

Issue with SPOOL

Hi, I use SunOS and i connect to database via isql. When tried using SPOOL command to extract the report from database, system thrown me saying "Spoool command not found". Please advise. (3 Replies)
Discussion started by: kusathy
3 Replies

4. Shell Programming and Scripting

UNIX/SQL loop to spool files!!

I want to spool files from unix using a sql script that would take values from another sql query within the KSH script.. unix loop select order_date from date_tbl for each order_Date i need to call this spool script with the value sqlplus scott/tiger@order_db @/ordspool/order_date.sql... (2 Replies)
Discussion started by: vr23
2 Replies

5. UNIX for Dummies Questions & Answers

Like spool in UNIX

Hi, Can you please help me how to spool the unix commands executed in my client and its output to a file in local machine. Basically, I want to save all OS commands executed in my session and its output into a file from my client something like we do oracle with "SPOOL". Thanks in advance.... (2 Replies)
Discussion started by: pointers
2 Replies

6. UNIX for Dummies Questions & Answers

Spool setting in unix environment for SAP

Hi All, Please help me regarding this. we have our SAP system with unix environment. Spool setting in unix ,we are not able to cancel any unix spool from SIDADM because the spool user is nor SIDADM. for example :- Any idea how to make the spool from OS level as SIDADM, Please suggest.... (3 Replies)
Discussion started by: dravi_laxmi
3 Replies

7. UNIX for Dummies Questions & Answers

Spool command in Unix

Hi, Is there any command in unix similar to spool command in oracle. (6 Replies)
Discussion started by: manosubsulo
6 Replies

8. Shell Programming and Scripting

how to spool a unix file

hi, can anyone help me by saying how can i spool a unix file.. do we need to specify the pathname as such to spool the file .. right now, i tried giving like spool filename in the sql prompt.. but its not giving me the required output even if i can see that the command is being executed.. ... (2 Replies)
Discussion started by: kripssmart
2 Replies

9. Shell Programming and Scripting

code to FTP the spool file from Sqlplus to the unix server.

I have a sqlplus report and inside that report I have the following piece of code to mail the report output to the email id. My requirement is, instead of emailing the output I want to FTP that script to a different unix server (say ip as 10.10.1.1). How to modify this code to FTP the spool file... (0 Replies)
Discussion started by: vprevin
0 Replies

10. UNIX for Dummies Questions & Answers

Spool Issue

Hi: At every month end I would like to collect the information of a spool. Every Spool has more then one job, below is the individual job information, I really want to collect into a text file. Sp-id Proc User Printer Id Pty Form Copy Total SP7494 MONTHEND SYED R123 P2 1 WIDE ... (3 Replies)
Discussion started by: shah2
3 Replies
Login or Register to Ask a Question