AWK new line feature getting nullified in outlook


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting AWK new line feature getting nullified in outlook
# 1  
Old 10-03-2012
AWK new line feature getting nullified in outlook

Hi,

I am using the below code to send mail to users showing the details of errors, and this happens in a loop till all the lines are validated.

Code:
printf ("%-6s%-12s%-1s%-1s%-36s%-10s%-10s%-10s%-4s%-500s%-s\n",fv_sup,fv_in,fv_rec,fv_flag,fv_err_owner,fv_create_user_id,fv_modify_user_id,fv_program_id,NR,fv_record,fv_err_desc)>>err_handle

But when the mail is sent outlook is showing the messages in a single line causing a lot of confusion just as below

Line 3: XXXXXXXXXXXXXXLine 3: XXXXXXXXXXXXXXXLine 7: XXXXXXXXXXXXXXLine 7:XXXXXXXXXXXXXXXX Line 11: XXXXXXXXXXXXXXX Line 11: XXXXXXXXXXX Line 15: XXXXXXXXXXXXXXXXXXXXXXXX

Can somebody help me bypass this problem and get the errors in seperate lines in the mail.
# 2  
Old 10-03-2012
If you'll be using this file only in Windows, try:
Code:
printf(".....\r\n",....)

# 3  
Old 10-03-2012
Hi Elixir,

Thanks for the quick reply.

I have tried "\r\n" but it seems to have no effect.

Outlook is still nullifying the line breaks.

Any other options that can get this thing done.

Regards
Ramki
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Printing string from last field of the nth line of file to start (or end) of each line (awk I think)

My file (the output of an experiment) starts off looking like this, _____________________________________________________________ Subjects incorporated to date: 001 Data file started on machine PKSHS260-05CP ********************************************************************** Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies

2. Shell Programming and Scripting

awk Script Output in Outlook Formatting Issue

When i execute the below shell script with 2 different Input files, for one of the data files (datafile1) my email message body in the outlook messes up and every thing comes up in one line. May i please know what i am doing wrong here or how to fix this? The only difference in data files is one is... (1 Reply)
Discussion started by: Ariean
1 Replies

3. Shell Programming and Scripting

How to read a two files, line by line in UNIX script and how to assign shell variable to awk ..?

Input are file and file1 file contains store.bal product.bal category.bal admin.bal file1 contains flip.store.bal ::FFFF:BADC:CD28,::FFFF:558E:11C5,6,8,2,1,::FFFF:81C8:CA8B,::FFFF:BADC:CD28,1,0,0,0,::FFFF:81C8:11C5,2,1,0,0,::FFFF:81DC:3111,1,0,1,0 store.bal.... (2 Replies)
Discussion started by: veeruasu
2 Replies

4. Shell Programming and Scripting

Long line displayed as multiple lines in Outlook. Please help!

When a file generated by a shell script is sent as a mail (not as an attachment), in MS Outlook, single lines of the file are displayed as two/three lines (as the lines are long). Is there a way to make each line to be displayed in 'single line with scroll bar' to enable viewing of the long line? (2 Replies)
Discussion started by: thulasidharan2k
2 Replies

5. Shell Programming and Scripting

Long line displayed as multiple lines in Outlook. Please help!

When a file generated by a shell script is sent as a mail (not an attachment), in MS Outlook, single lines of the file are displayed as two/three lines (as the lines are long). Is there a way to make each line to be displayed in 'single line with scroll bar' to enable viewing of the long line? ... (0 Replies)
Discussion started by: thulasidharan2k
0 Replies

6. Shell Programming and Scripting

A twisted feature of sort when called in awk

Hello, In the book Classic Shell Scripting, there is an example showing how you can call a shell command through awk's pipe: for (name in telephone){ print name "\t" telephone | "sort" } close("sort") The output, as seen from the terminal, is perfectly the sorted list of name-tel... (10 Replies)
Discussion started by: nrgbooster
10 Replies

7. Shell Programming and Scripting

Awk not working due to missing new line character at last line of file

Hi, My awk program is failing. I figured out using command od -c filename that the last line of the file doesnt end with a new line character. Mine is an automated process because of this data is missing. How do i handle this? I want to append new line character at the end of last... (2 Replies)
Discussion started by: pinnacle
2 Replies
Login or Register to Ask a Question