Formatting Help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Formatting Help
# 1  
Old 04-13-2012
Formatting Help

Hi Guys,

i have report that runs every 10 min and send the report of failed jobs to my mail.

Currently i am using a command like this to send mail.

Code:
mailx -t -s "FAILURE JOBS IN HYDRA $temp_date" addressee@domain.com < temp_file5

But i am getting mail in this format ....
Code:
newcmo_trace_hold_pl        newcmo_daily_cycle     04/12/2012 08:50:29      04/12/2012 08:50:44     Yes      s(newcmo_rowcounts)
rigs_alleyoop_apply            rigs_daily_cycle            04/12/2012 08:52:50      04/12/2012 08:53:30     No       -------

output in unix in temp_file5 looks like this (in a kind of Tabular Form) ....
Code:
newcmo_chk_rack_triggers            newcmo_daily_cycle          04/13/2012 06:10:15         04/13/2012 06:10:22            No                              -------                                          
rigs_alleyoop_apply                 rigs_daily_cycle            04/13/2012 06:47:25         04/13/2012 06:48:19            No                              -------

Is there anyway that i could get the body of mail as the one in unix style ....

Please Help .... Thanks

Last edited by methyl; 04-13-2012 at 11:24 AM.. Reason: remove real email address. please use code tags. lay out again
# 2  
Old 04-13-2012
Please review your post now I have laid it out with code tags. I can't see a correlation between the two samples.
Are there tab characters in the file?
What mail reader do you use?
# 3  
Old 04-13-2012
Hi,

Yes the one that is see in unix has Tab spacing, but the one that i get mail does not have.

i use this to format the entries ...

Code:
fmt3='%-35s %-27s %-27s %-30s %-31s %-48s \n'

and run this command in a loop ...

Code:
printf "$fmt3" "$job_name" "$cycle_name" "$srt_time" "$end_time" "$job_depd" "$srt_cond" >> temp_file5

I use outlook

Last edited by gkrish; 04-13-2012 at 11:37 AM.. Reason: please use code tags
# 4  
Old 04-13-2012
I can't see any tab characters in your code.

If you are using Microsoft Outlook as a mail reader, uncheck this setting:
Tools / Options / Preferences / E-mail options / Remove extra line breaks in plain text messages.
# 5  
Old 04-13-2012
I did what you mentioned but ... i am still getting the mails in this format ...


rigs_alleyoop_apply rigs_daily_cycle 04/13/2012 06:47:25 04/13/2012 06:48:19 No -------
rdc_load rdc_feed_cycle 04/13/2012 09:43:30 04/13/2012 10:23:57 No s(rdc_archive)


i mean they are not aligned .... is there any way that i could align all the columns (Like that in a Table).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with formatting

Hi, I am new to UNIX and need your help in formatting the below input command to the desire output Input: CREATE UNIQUE INDEX XPKTABLE1 ( COL1, COL2 ) ON TABLE_NM; Output: COMMENT ON TABLE DB_NM.TABLE_NM AS 'PK=,COL1,COL2; '; In... (14 Replies)
Discussion started by: varun2327
14 Replies

2. Shell Programming and Scripting

Formatting

Good day All, I have requirement where my input data looks like below ] Message5 Expecting Output as 04/MAR/2104 ||| 23:15:45 ||| servername ||| NOTIFICATION |||message1||||||userId|||||| Message5 I could not use space delimiter as in the messages I would be having them as... (2 Replies)
Discussion started by: Tomlight
2 Replies

3. Shell Programming and Scripting

help formatting

I need to format a txt file and convert it in CSV. Any "future" column is separated by a newline. FROM: XS1 1.43294 0.0 XS2 1.21824 0.0 TO: XS1,XS2 (2 Replies)
Discussion started by: alfreale
2 Replies

4. Shell Programming and Scripting

formatting of df -k

Hello, I am developing a platform Independant tool that should work for all major unix flavors outlined in this forum(Solaris,Linux, AIX, HPUX, SCO,BSD) Therefore, in order to cover all types of user community, I have deliberately posted the same message on every forum. Please do not think... (9 Replies)
Discussion started by: darsh123
9 Replies

5. Shell Programming and Scripting

Formatting

Is there a way to make a 2 column output out of the following : 1 2 3 4 5 6 Output : 1 2 3 4 5 6 Thanks, Prasanna (3 Replies)
Discussion started by: prasanna1157
3 Replies

6. Shell Programming and Scripting

formatting

I have file with different columns for ex. contents of file "txt" NAME AGE MARKS HARRY 23 89 TOM 12 67 BOB 23 11 and you see its not formatted.Now, I need the file "txt" to be formatted like COLUMN1 COLUMN2 COLUMN3 NAME AGE ... (3 Replies)
Discussion started by: vijay_0209
3 Replies

7. Shell Programming and Scripting

Formatting

I have next part of script: for i in $LIST do echo "`date +"%H:%M:%S"` Converting $i ..."; mysql -uroot some -sABe "ALTER TABLE $i ENGINE=$ENGINE"; done I want to get following output formatting: "OK" must be one under another :) ... (3 Replies)
Discussion started by: mirusnet
3 Replies

8. UNIX for Dummies Questions & Answers

formatting

Hi Again Guys , Please i installed linux RH 6.1 on Toshiba , 10G , RAM=128 , 600 MHZ . After i installed linux i got many error messages , seems it was not installed correctly , also when i finished installation it did not ask me for the 2nd installation CD , and when i logged as root , i... (5 Replies)
Discussion started by: tamemi
5 Replies

9. UNIX for Dummies Questions & Answers

formatting

is it possible to format a powerbook g4 mac? like totally erase the HD then pop in the Mac OS cd and it will boot up an install like windows or any linux? (5 Replies)
Discussion started by: xeron
5 Replies

10. UNIX for Dummies Questions & Answers

formatting

I've been asking on IRC channels but no one answers me, I need to format my hard drive, normally it's just format c: but c doesn't exist, how do I format when I have linux mandrake installed. Please reply to this quickly, I'm kinda in a rush :( (1 Reply)
Discussion started by: darryll777
1 Replies
Login or Register to Ask a Question