[Solved] Shell script output in HTML or with table like results and mail


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [Solved] Shell script output in HTML or with table like results and mail
# 8  
Old 01-17-2014
If the expression $3 >=80 is evaluating to TRUE when the 3rd field contains the value 9, awk must be performing a string comparison instead of a numeric comparison. Try changing:
Code:
                        if ($3 >=80 )

to:
Code:
                        if (($3 + 0) >=80 )

Of course, we haven't seen any sample input in this thread. It might help if we could see an input sample that is leading to these unexpected results.
This User Gave Thanks to Don Cragun For This Post:
# 9  
Old 01-17-2014
Thanx a lot,
its working Smilie
# 10  
Old 01-20-2014
hi,

facing issue while i am passing a file to this code and when its converting and merging the 1st column , when its come to string starting with "S" (capital S) on 1st column.
Code:
        NR == FNR {
                if ( $0 !~ /^#/ && $0 !~ /^S/ )
                        C[$1]++
                next


Please help.

Last edited by Franklin52; 01-20-2014 at 06:56 AM.. Reason: Please use code tags
# 11  
Old 01-20-2014
Quote:
Originally Posted by joy lobo
hi,

facing issue while i am passing a file to this code and when its converting and merging the 1st column , when its come to string starting with "S" (capital S) on 1st column.
Code:
        NR == FNR {
                if ( $0 !~ /^#/ && $0 !~ /^S/ )
                        C[$1]++
                next


Please help.
When you have a new problem, please start a new thread.

When you give us four lines out of an awk script with no indication of what you're trying to do and no indication of what you think these lines are doing wrong, there isn't much we can do to help.

Please start a new thread. In that thread, show us your complete awk script, sample input to the script, corresponding sample output you want from the script, and an explanation of what transformations are supposed to be applied.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Postgre Query results as Email HTML table

Hello, I'm trying to send email from Greenplum query results as HTML table with status Red/Green Select Server, Last_Date from Table; Results Server, Last_Date Prod, 2018-04-09 Final email Output in HTML format Server Status LastDate Prod GREEN(BOX) 2018-04-09 (if... (2 Replies)
Discussion started by: krux_rap
2 Replies

2. Shell Programming and Scripting

Convert shell script output txt file to html table

My concnern related to the post -Convert shell script output txt file to html table, in this how to print the heading as color. awk 'BEGIN{print "<table>"} {print "<tr>";for(i=1;i<=NF;i++)print "<td>" $i"</td>";print "</tr>"} END{print "</table>"}' <filename> (8 Replies)
Discussion started by: sarajobmai
8 Replies

3. Shell Programming and Scripting

I want query output to send on mail using table tag and output should be in table

#! /bin/ksh #] && . ./.profile 2>/dev/null if test -f '.profile'; then . ./.profile; fi; #. .profile LOG_DIR=/app/rpx/jobs/scripts/just/logs sendEmail() { pzCType="$1"; pzTitle="$2"; pzMsg="$3"; pzFrom="$4"; pzTo="$5"; pzFiles="$6"; pzReplyTo="$7" ( ... (21 Replies)
Discussion started by: ankit.mca.aaidu
21 Replies

4. Shell Programming and Scripting

Insert an image in HTML mail sent from Shell script

Hi Shell Experts I am trying to insert an image into HTML email through shell script send mail, I have the email text file which included body and the images included in it in html format. Through my Shell script, I am calling the text file and send it through email so it it sends the email with... (21 Replies)
Discussion started by: anji009
21 Replies

5. Shell Programming and Scripting

[SOLVED] Read html attachment from /var/mail

Hi, I am receiving an email to the server with a html attachment. When I check the /var/mail the attachment is showing as junk characters. I want to move that html file to a particular location in that server. Please help me. Regards Neethu (4 Replies)
Discussion started by: Neethu
4 Replies

6. Shell Programming and Scripting

Convert shell script output txt file to html table

Hi, I have script which generates the output as below: Jobname Date Time Status abc 12/9/11 17:00 Completed xyz 13/9/11 21:00 Running I have the output as a text file. I need to convert it into a HTML Table and sent it thru email ... (6 Replies)
Discussion started by: a12ka4
6 Replies

7. Shell Programming and Scripting

Bash shell script that inserts a text data file into an HTML table

hi , i need to create a bash shell script that insert a text data file into an html made table, this table output has to mailed.I am new to shell scripting and have a very minimum idea of shell scripting. please help. (9 Replies)
Discussion started by: intern123
9 Replies

8. Shell Programming and Scripting

shell script output in HTML or with table like results

Hello, Currently i have a ksh script which will disply the results in plain text format. I want to format the result in more readable format like Making bold headings and format with colors etc. Something like html or excel format and send that content as email. Please help me how i can do... (2 Replies)
Discussion started by: kotasateesh
2 Replies

9. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

Hi The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment . cat Employee.sql SET VERIFY OFF SET PAGESIZE 200 SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON - HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies

10. Shell Programming and Scripting

have a shell script done in pl/sql and want output in html

I have this shell script where I have both pl/sql and sql. But want to have a snigle output file where the result of each cursors are in HTML tables. I was able to do that on my old script but it was only sql scripts (no pl/sql). Can I do have such outputs now with my new script where I... (2 Replies)
Discussion started by: arobert
2 Replies
Login or Register to Ask a Question