Sponsored Content
Top Forums Shell Programming and Scripting Count the number or row with same value in a column Post 302480114 by sQew on Tuesday 14th of December 2010 04:44:44 AM
Old 12-14-2010
Count the number or row with same value in a column

This is the source file, we called it errorlist.out
Code:
196    server_a    server_unix_2    CD
196    server_b    server_win_1    CD
196    server_c    server_win_2    CD
196    server_bd    server_unix_2    CD
196    server_d    server_unix_2    CD
196    server_es    server_win_1    CD
196    server_f    server_unix_2    CD
196    server_gs    server_win_2    CD
196    server_h    server_win_2    CD
196    server_1    server_unix_3    CD
196    server_ae    server_unix_2    CD
196    server_ca    server_unix_3    CD
196    server_az    server_win_2    CD
196    server_aw    server_win_1    CD
196    server_t    server_win_2    CD
196    server_uv    server_unix_2    CD
196    server_r    server_win_2    CD
196    server_rt    server_win_1    CD
196    server_ut    server_win_2    CD
196    server_zx    server_unix_3    CD
25    server_re    server_unix_3    CD
13    server_vc    server_unix_3    CD
58    server_ze    server_unix_3    CD
58    server_ae    server_unix_2    CD
57    server_ca    server_unix_3    CD
6    server_az    server_win_2    CD
6    server_aw    server_win_1    CD

I want to achive something like this:

If code 196 more than 10, i want sent email with all those information to my email.
For other code, separate email will be sent.

Im thinking might be can use awk,but all syntax i'll use have an error. Anyone can point me the right syntax to get this done?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

row count but only number part

hi i am pretty new to unix .i am ETL guy I need a unix script to take row count of a file and write it to another file the problem with wc-l is it include filename also wc -l abc.dat will give me like 1000 abc.dat i just want 1000 to be written can u just take 2 min to write a simple... (1 Reply)
Discussion started by: er_zeeshan05
1 Replies

2. Shell Programming and Scripting

count number of nonempty columns in row

Hi, Suppose i have a inputfile in csv format. How to use awk to count 'the number of nonempty columns in each row' minus one, and add the value as a new column in the end For cosmetic reason, it's even better to include a descriptive label for the last column in the first row. for... (2 Replies)
Discussion started by: grossgermany
2 Replies

3. UNIX for Dummies Questions & Answers

deleting a row if a certain column is below a certain number

How can you delete a row if a certain column is bigger than a certain number? I have the following input: 20080709 20081222 95750 1 0 0.02 94.88 20080709 20081222 95750 2 0 0.89 94.88 20080709 20081222 9575 1 0 0 94.88 20080709 20081222 9575 2 0 0 94.88 20080709 20081222 9587.5 1 0 0... (1 Reply)
Discussion started by: Pep Puigvert
1 Replies

4. UNIX for Dummies Questions & Answers

deleting a row if a certain column is below a certain number

How can you delete a row if a certain column is bigger than a certain number? I have the following input: 20080709 20081222 95750 1 0 0.02 94.88 20080709 20081222 95750 2 0 0.89 94.88 20080709 20081222 9575 1 0 0 94.88 20080709 20081222 9575 2 0 0 94.88 20080709 20081222 9587.5 1 0 0... (6 Replies)
Discussion started by: Pep Puigvert
6 Replies

5. UNIX for Dummies Questions & Answers

Adding a column with the row number using awk

Is there anyway to use awk to add a first column to my data that automatically goes from 1 to n , where n is the numbers of my rows?:confused: (4 Replies)
Discussion started by: cosmologist
4 Replies

6. Linux

Serial terminal emulation - bad row column count ?

Hello, I connect to linux using serial cable from windows machine. I use putty as serial terminal emulator. Everything works fine except programs which scroll text - man, more, less, vi, etc.. These programs asumme my terminal size is 80cols x 24rows (my putty window size is more than that,... (1 Reply)
Discussion started by: vilius
1 Replies

7. Shell Programming and Scripting

how to add the number of row and count number of rows

Hi experts a have a very large file and I need to add two columns: the first one numbering the incidence of records and the another with the total count The input file: 21 2341 A 21 2341 A 21 2341 A 21 2341 C 21 2341 C 21 2341 C 21 2341 C 21 4567 A 21 4567 A 21 4567 C ... (6 Replies)
Discussion started by: juelillo
6 Replies

8. UNIX for Dummies Questions & Answers

I want count of number of records to be printed on each row.

we want the count of number of records to be printed on each row. For Ex: if there are 5 records on one unique id , the count "5'' should be printed on each record in other column. Please help for this. I am using unix & Cygwin. Below are sample records: KCZ0650473... (2 Replies)
Discussion started by: ElijaRajesh
2 Replies

9. UNIX for Beginners Questions & Answers

Copy columns from one file into another and get sum of column values and row count

I have a file abc.csv, from which I need column 24(PurchaseOrder_TotalCost) to get the sum_of_amounts with date and row count into another file say output.csv abc.csv- UTF-8,,,,,,,,,,,,,,,,,,,,,,,,, ... (6 Replies)
Discussion started by: Tahir_M
6 Replies

10. Shell Programming and Scripting

Reseting row count every given number of rows

I have a file with 48 rows. I am counting 6 rows and adding 6 to that number and repeating the operation, and then output the value in column 1. For the second column, I would like to get sort of a binary output (1s and 2s) every 3rd row. This is what I have: awk '{print ++src +... (1 Reply)
Discussion started by: Xterra
1 Replies
TIFFCHECK(8C)															     TIFFCHECK(8C)

NAME
tiffcheck - check TIFF for HylaFAX conversion requirements SYNOPSIS
/usr/sbin/tiffcheck [ options ] file.tif DESCRIPTION
tiffcheck takes TIFF input and writes a multi-line text message to the standard output describing any work needed to prepare the images for facsimile transmission. tiffcheck is usually invoked by tiff2fax(8C) script that is used by the HylaFAX scheduler to prepare TIFF docu- ments submitted for transmission. The first line of output is a series of ``+''-separated words that indicate if the input file should be: o rejected (``REJECT''), o reformatted with a different data-encoding scheme (``REFORMAT''), o scaled to different page dimensions (``RESIZE''), o reimaged in a different vertical resolution (``REVRES''), or o reimaged for other reasons such as conversion from color to black&white (``REIMAGE''). The conversion requirements string will always have keywords in the above order; e.g. ``RESIZE+REVRES'' if the input file needs to be scaled and converted to a different resolution. Information following the first line is descriptive text that explains the reason(s) for the file conversion(s); this text is suitable for return to a client (should document conversion fail or not be attempted). The descrip- tive text is ordered identically to the keywords in the conversion string; this makes it possible to match up conversion requirements to reasons. OPTIONS
The following operations are recognized: -1 Set output to be Group 3 1D-encoded. -2 Set output to be Group 3 2D-encoded. -3 Set output to be Group 4 MMR-encoded. -w width Set the output page width, in pixels. By default, pages are 1728 pixels wide. -l length Set the output page length in millimeters. By default, pages are 297 millimeters long. -r vres Set the vertical resolution, in lines/inch, at which to image the . EXAMPLES
The following color image needs to be converted to black&white, resized to the output page dimensions, and reformatted to use Group 3 1D- encoded data. hyla% /usr/sbin/tiffcheck jello.tif REFORMAT+RESIZE+REIMAGE Document is not a bilevel image (bits/sample 8). Document requires reformatting, not in Group 3 format. Document requires resizing to adjust page width (convert to 1728, document is 256). This image is a facsimile received at high resolution (196 lpi); it only needs to be converted to 98 lpi. hyla% /usr/sbin/tiffcheck faxix.tif REVRES Document requires reformatting to adjust vertical resolution (convert to 98, document is 196). SEE ALSO
tiff2fax(8C), faxq(8C), hylafax-server(5F) January 18, 1996 TIFFCHECK(8C)
All times are GMT -4. The time now is 07:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy