To have a mail in tabular format


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting To have a mail in tabular format
# 8  
Old 11-30-2018
Instead of asking us to keep up with your changing requirements, why don't you take the code RudiC suggested and try modifying it to meet your added requirements? We are here to help you learn how to write your own code; not to act as your unpaid programming staff for constantly changing requirements.

If you can't figure out what his code is doing after reading the awk man page on your system, ask us to explain what the code that you don't understand is doing. We want to help you learn how to write your own awk scripts.

Show us how you tried to modify it and tell us where you have problems if you can't get it to work.

If you do get it to work, show us what you came up with. Maybe we'll be able to show you shortcuts that will make your code work faster or more reliably. Again... we want to help you learn how to write your own code. (And, please use CODE tags when displaying sample input, sample output, and code segments.)
These 2 Users Gave Thanks to Don Cragun For This Post:
# 9  
Old 12-26-2018
Hello bukinin,
Quote:
OK, and: which ones?? Will this just be a fixed list, will they come from a file with queue names
reply to your questions : yes it fixed list three or 4 fixed queue names with specified limit . if it crosses the limit then only should pop out the result and trigger mail else should not consider in the output.
for example for QL.PGHR.GVR.ERR.LOG 298 this queue limit is 300 so should not appear in mail/output.
# 10  
Old 12-27-2018
Hello wims,


pls. read, understand, and apply Don Cragun's post #8. Feel free to post here again for help if you get stuck. If so, provide (broad, and detailed) enough information to enable people in here to understand and work upon your problem.


Half baked answers (like yours in post #9) usually DON'T help. Where does the list come from - a file? An array? Divine revelation? How formatted? In other words - show data!
# 11  
Old 12-27-2018
Quote:
Originally Posted by wims
Hello bukinin,
Hello wums,

Quote:
Originally Posted by wims
for example for QL.PGHR.GVR.ERR.LOG 298 this queue limit is 300 so should not appear in mail/output.
My suggestion is to - for reasons of extensibility and maintainability - not to include it into the code directly but to create a file with queue names and their threshholds, like this:

Code:
QL.QUEUE1     50
QL.QUEUE2     75
QL.QUEUE3     100

At the start of your program you read in this file line by line and create an associative array of integers with the queue names as index and the threshhold values as values. When a line with a queue name is to be printed you first consult this array and if the queue name is in there you compare the queues length with the threshhold value and decide upon this if it is to ve included in the report or not.

Decisions you will have to make still are: what will happen if a queue is not included in this list. You have several options i could think of: a queue not included in the list is considered to have a threshhold of 0. This resembles what we started with. Another possibility is to ignore every queue not included in the list (so that in fact their "threshhold value is infinite". This way the list in your file would contain an extensive list of the queues you are interested in. Another possibility is to declare a general threshhold so that queues only get reported when they are crossing this threshhold. ONly the queues in the list will have their own differing threshhold value set according to this list. This is quite similar to the first possibility but there you'd have a general threshhold of zero.

I hope this helps.

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. Shell Programming and Scripting

Convert text file to HTML tabular format.

Please provide script/commands to convert text file to HTML tabular format. No need of styles and colours, just output and a heading in table is required. Output file will be send via email and will be seen from outlook. (script required without using awk). output file content: (sar... (7 Replies)
Discussion started by: Veera_V
7 Replies

4. Shell Programming and Scripting

Mailing query results in tabular format

Hi , I am purging two tables based on date. In my script I am taking the count of the tables purging them and then taking the after counts. I need to mail the before and after counts of the two tables in a mail in table format as mentioned in the result section. For Eg: ## Count of the... (14 Replies)
Discussion started by: CFA
14 Replies

5. Shell Programming and Scripting

Grep command output in tabular format

I have a grep command script which works fine and give the correct results but i wanted the output to be displayed in tabular format ? Is it possible to display the output in tabular format and as well direct them to some file. main script : #!/usr/bin/bash Start_Time=`date '+%m%d%y... (1 Reply)
Discussion started by: Optimus81
1 Replies

6. Shell Programming and Scripting

Convert data to a tabular format

How can i convert the below data to a simpler format :- cat tabular.txt User 1 Details :- First Name = Tom Middle Name = Last Name = Hanks Age = 40 Address = User 2 details :- First Name = Mike Middle Name = Last Name = Tyson Age = 50 Address = (2 Replies)
Discussion started by: lazydev
2 Replies

7. Shell Programming and Scripting

Extract data in tabular format from multiple files

Hi, I have directory with multiple files from which i need to extract portion of specif lines and insert it in a new file, the new file will contain a separate columns for each file data. Example: I need to extract Value_1 & Value_3 from all files and insert in output file as below: ... (2 Replies)
Discussion started by: belalr
2 Replies

8. UNIX for Advanced & Expert Users

How to export Result to Excel Tabular format from UNIX?

Hi I am working on a script in which I am firing a query on database through Unix and getting the result set. I want to export that in an excel file. I am able to do so nut the result are exported horizontally one below the other. Can anyone plss help me out in exporting the Result in Tabular... (4 Replies)
Discussion started by: Saritau3
4 Replies

9. 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

10. Shell Programming and Scripting

Displaying the output in the tabular Format

Hi, I have a file which contains the data in the below format and need to develop a script which will give the output in the tabular format. Could you please advice me. Folder: Workflow: version . Workflow run status: Workflow run error code: Schedule time: Workflow run type: ... (2 Replies)
Discussion started by: kandi.reddy
2 Replies
Login or Register to Ask a Question