Required to get out put of log in tabular format in email body


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Required to get out put of log in tabular format in email body
# 1  
Old 07-26-2016
Required to get out put of log in tabular format in email body

Dears Please support

I have out put in text file and look like below
Code:
fixed inquiries - Click on MAX suffix http://server:port/app
User Details  http://server:port/app
Audit User Detail Action hhttp://server:port/app
fixed inquiries - Click on MAX suffix http://server:port/app
User Details  http://server:port/app
Audit User Detail Action http://server:port/app
fixed inquiries - Click on MAX suffix http://server:port/app

This is one column
fixed inquiries - Click on MAX suffix
This is other column http://server:port/app

I used below command to take output in different html format and it is giving me tabular format but how can i put color because it is white background.which place and how i should update color
Code:
nawk 'BEGIN{print "<table>"} {print "<tr>";for(i=1;i<=NF;i++)print "<td>" $i"</td>";print "</tr>"} END{print "</table>"}' ERROR_FILE.log > ERROR_FILE.xls

fixed inquiries - Click on MAX suffix
and i want script to consider above in one column
like before http it should be in one column and later should be in other

please support to help me add color and also help me make my output come in two columns

Last edited by RudiC; 07-26-2016 at 09:19 AM.. Reason: Changed some ICODE tags to CODE tags.
# 2  
Old 07-26-2016
Show the input you have and the output you want.
# 3  
Old 07-26-2016
in put in file look like this and there can b n number of rows
Code:
fixed inquiries - Click on MAX suffix http://server:port/app
User Details  http://server:port/app
Audit User Detail Action hhttp://server:port/app
fixed inquiries - Click on MAX suffix http://server:port/app
User Details  http://server:port/app
Audit User Detail Action http://server:port/app
fixed inquiries - Click on MAX suffix http://server:port/app

output i want is like below
fixed inquiries - Click on MAX suffix in one column in table
and this is other columnhttp://server:port/app

and i want to print out put in email body in a tabular form.

Thanks in advance

---------- Post updated at 10:08 PM ---------- Previous update was at 09:41 PM ----------

Quote:
Originally Posted by Corona688
Show the input you have and the output you want.
in put in file look like this and there can b n number of rows
Code:
fixed inquiries - Click on MAX suffix http://server:port/app
User Details  http://server:port/app
Audit User Detail Action hhttp://server:port/app
fixed inquiries - Click on MAX suffix http://server:port/app
User Details  http://server:port/app
Audit User Detail Action http://server:port/app
fixed inquiries - Click on MAX suffix http://server:port/app

output i want is like below
fixed inquiries - Click on MAX suffix in one column in table
and this is other columnhttp://server:port/app

and i want to print out put in email body in a tabular form.

Thanks in advance

---------- Post updated at 10:34 PM ---------- Previous update was at 10:08 PM ----------

Quote:
Originally Posted by Corona688
Show the input you have and the output you want.
awaiting your feedback on this please

Last edited by RudiC; 07-26-2016 at 01:42 PM.. Reason: Changed some ICODE tags to CODE tags.
# 4  
Old 07-26-2016
Awaiting your answer to Corona688's questions.
# 5  
Old 07-26-2016
And, don't repeat your post#1 for the fourth time. Show the output and the logic/rules/algorithms that connect it with your input.
# 6  
Old 07-26-2016
Quote:
Originally Posted by RudiC
Awaiting your answer to Corona688's questions.
Dear Rudic,
i already provide my input file

Code:
fixed inquiries - Click on MAX suffix http://server: port/app
User Details  http://server: port/app
Audit User Detail Action http://server: port/app
fixed inquiries - Click on MAX suffix http://server: port/app
User Details  http://server: port/app
Audit User Detail Action http://server: port/app
fixed inquiries - Click on MAX suffix http://server: port/app

and i want out in tabular form in two coloms, with some color
one column before http and other with https till app.
out put required like below
Code:
fixed inquiries - Click on MAX suffix | http://server: port/app
Audit User Detail Action | http://server: port/app

---------- Post updated at 11:04 PM ---------- Previous update was at 10:44 PM ----------

Quote:
Originally Posted by RudiC
And, don't repeat your post#1 for the fourth time. Show the output and the logic/rules/algorithms that connect it with your input.
Dear,

is the input requirement clear now, or do i need to provide more info on this ?

please help

Last edited by RudiC; 07-26-2016 at 03:37 PM.. Reason: Added code tags.
# 7  
Old 07-26-2016
Dear Mirwasim,
You posted the input several times. But the output Corona and Rudy want to see is not so clear. Based on your script I guess you want this output:
Code:
<TABLE>
  <TR>
    <TD>fixed inquiries - Click on MAX suffix</TD>
    <TD>http://server: port/app</TD>
  </TR>
  ...
</TABLE>

That is enough for one question.
But you are also telling you want to mail this. Do you understand you will have to add HTML tags and perhaps more?
To mail this as a html you will have to set a mime type. That would be an other question.
Hope this helps.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To have a mail in tabular format

Hello Guys, developing a monitoring shell script to have my queue depth count over mail . here is the sample input file to the script which has all the queue names 1 : DISPLAY QUEUE(*) WHERE (CURDEPTH GT 0) ZFC8409: Display Queue details. QUEUE(QL.GVR.ATA.CACHE.01) ... (10 Replies)
Discussion started by: wims
10 Replies

2. Shell Programming and Scripting

Adding a blank line in between two O/Ps in tabular format which gets received over email

Hi Guys, I am stuck in between and seeking help here. Requirement: A script that will run every morning which will connect to Mysql database and run the query to inform us about the holidays (it will also check if there were any holidays during last 2 business days). So the three queries are... (11 Replies)
Discussion started by: Sambit Sahu
11 Replies

3. Shell Programming and Scripting

Fetching the required data out of a tabular form

Hello Gurus, I am trying to fetch a required number of lines from an output of a command which is in tabular form. Below is the command for reference along with how the result is being shown on UNIX shell. /usr/openv/volmgr/bin/vmquery -b -p 5 The result of the above command is as... (6 Replies)
Discussion started by: Ali Sarwar
6 Replies

4. Shell Programming and Scripting

Body content is in random format while sending email from Linux to my outlook.

Hi I have a script running in lunix machine which emails log file content to my outlook. Here is the actual log file result: Image-1 In-Master:25028 ReplicaDn Consumer Supplier Delay dc=xxx,dc=com lmjker0110:12345 ... (4 Replies)
Discussion started by: buzzme
4 Replies

5. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

6. Shell Programming and Scripting

Outlook Email Body Format Issue

Hello All, I been trying to get a solution for a while not able to figure out. I am generating a file and sending that as an body of message to my outlook account. For some reason reason everything is showing up as one line in the email. for i in `cat "${GEN_PARAM_LIST3}"` do ... (0 Replies)
Discussion started by: Ariean
0 Replies

7. Shell Programming and Scripting

Displaying output in the tabular format

Hi I want to display the following input data into the tabular format as shown in the output. Input.txt: Following jobs are in pending state for more than 10 minutes: JOB_ID JOB_SUBMIT_ID MAHAR 784308 PUNJA 109367 Following jobs are running for longer time: JOB_ID... (1 Reply)
Discussion started by: dats
1 Replies

8. UNIX for Dummies Questions & Answers

Put data in tabular form..

Dear Friends, I have a file as under : +++ ME 12-06-13 18:16:20 A RED FEW AND ROW1 1MN FEL AS HI FI BV LR TS HR ES MR * 0 13296 0 120 1 15 KS RR 10 0 +++ ME 12-06-13 18:26:20 A RED FEW AND ROW2 1MN FEL AS... (2 Replies)
Discussion started by: vanand420
2 Replies

9. UNIX for Dummies Questions & Answers

Put data into tabular form

Hi I am having a file which is required to be presented in the under-noted output form. Please suggest. Input: Kapil: apple 4 banana 6 cherry 0 Manoj: apple 13 banana cheery 2 Output: apple banana cherry Kapil: 4 6 0 Manoj: 13 2 Thanks in... (4 Replies)
Discussion started by: vanand420
4 Replies

10. Shell Programming and Scripting

how to put subject and body to mail from two files

Hi all, My sample file is something like this, ORA-00206: Message 206 not found; product=RDBMS; facility=ORA ORA-00202: Message 202 not found; product=RDBMS; facility=ORA ORA-27063: Message 27063 not found; product=RDBMS; facility=ORA ORA-00206: Message 206 not found; ... (1 Reply)
Discussion started by: sri1977
1 Replies
Login or Register to Ask a Question