Sponsored Content
Top Forums Shell Programming and Scripting Awk to Count Records with not null Post 302367439 by pinnacle on Monday 2nd of November 2009 03:49:44 PM
Old 11-02-2009
Awk to Count Records with not null

Hi,

I have a pipe seperated file
I want to write a code to display count of lines that have 20th field not null.

Code:
nawk -F"|" '{if ($20!="") print NR,$20}' xyz..txt

This displays records with 20th field also null.

I would like output as:

Quote:
2000 (number of lines with not null 20th field)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

finding null records in data file

I am having a "|" delimited flat file and I have to pick up all the records with the 2nd field having null value. Please suggest. (3 Replies)
Discussion started by: dsravan
3 Replies

2. Shell Programming and Scripting

Count No of Records in File without counting Header and Trailer Records

I have a flat file and need to count no of records in the file less the header and the trailer record. I would appreciate any and all asistance Thanks Hadi Lalani (2 Replies)
Discussion started by: guiguy
2 Replies

3. UNIX for Dummies Questions & Answers

Count records in a zip file

Hello, I searched the forums on the keywords in the title I used above, but I did not find the answer: Is it possible to count records in a .zip file on an AIX machine if i don't have pkunzip installed? From all the research I'm reading in google and the reading of pkunzip in Unix.com,... (3 Replies)
Discussion started by: tekster757
3 Replies

4. Shell Programming and Scripting

exclude records with null fields

Hi, can I do something like this to add a condition of checking if the 4th field is number or space or blank also: awk -F, '$4 /^*||*/' MYFILE >> OTHERFILE I also want the other part i.e. I need to exclude all lines whose 4th field is space or blank or number: MYFILE a,b,c,d,e a,b,c,2,r... (2 Replies)
Discussion started by: praveenK_Dudala
2 Replies

5. Shell Programming and Scripting

using awk to count no of records based on conditions

Hi I am having files with date and time stamp as the folder names like 200906051400,200906051500,200906051600 .....hence everyday 24 files will be generated i need to do certain things on this 24 files daily file contains the data like 200906050016370 0 1244141195225298lessrv3 ... (13 Replies)
Discussion started by: aemunathan
13 Replies

6. Shell Programming and Scripting

count of null in pipe delimited txt file

Hi, I have a pipe delimited txt file which contains 17 fields per line/row. 16th field contains email id. I want to count the number of lines/rows that contains null in the 16th field. Plz find attached example data file. I'm looking for a command line/script which achieves this. ... (5 Replies)
Discussion started by: Sriranga
5 Replies

7. Shell Programming and Scripting

How to count dup records in file?

Hi Gurus, I need to count the duplicate records in file file abc abc def ghi ghi jkl I want to get below result: abc ,2 abc, 2 def ,1 ghi ,2 ghi, 2 jkl ,1 or abc ,2 def ,1 (3 Replies)
Discussion started by: ken6503
3 Replies

8. Shell Programming and Scripting

UNIX scripting for finding duplicates and null records in pk columns

Hi, I have a requirement.for eg: i have a text file with pipe symbol as delimiter(|) with 4 columns a,b,c,d. Here a and b are primary key columns.. i want to process that file to find the duplicates and null values are in primary key columns(a,b) . I want to write the unique records in which... (5 Replies)
Discussion started by: praveenraj.1991
5 Replies

9. Shell Programming and Scripting

Count records in a block

Hi, We have a file that has a structure like this: H10 1 2 3 D10 1 D20 1 2 3 D20 3 4 5 D20 4 5 6 D10 2 D20 1 2 3 D20 3 4 5 D20 4 5 6 S10 10 H10 1 2 3 D10 1 D20 1 2 3 D20 3 4 5 D20 4 5 6 D10 2 (2 Replies)
Discussion started by: jerome_rajan
2 Replies

10. Shell Programming and Scripting

Count null values in a file using awk

I have the following a.txt file A|1|2|3|4|5| A||2|3|0|| A|1|6||8|10| A|9|2|3|4|1| A|0|9|3|4|5| A||2|3|4|5| A|0|av|.9|4|9| I use the following command to count null values for 2nd field awk -F"|" '!$2 { N++; next } END {print N}' a.txt It should give the result 2, but it is giving... (2 Replies)
Discussion started by: RJG
2 Replies
rocks(6x)							XScreenSaver manual							 rocks(6x)

NAME
rocks - animation of flying through an asteroid field SYNOPSIS
rocks [-display host:display.screen] [-foreground color] [-background color] [-window] [-root] [-mono] [-ncolors n] [-install] [-visual visual] [-count integer] [-delay usecs] [-speed integer] [-norotate] [-nomove] [-3d] [-fps] DESCRIPTION
The rocks program draws an animation of an asteroid field moving past the observer (or vice versa). Sometimes the observer picks up spin on Z axis. OPTIONS
rocks accepts the following options: -window Draw on a newly-created window. This is the default. -root Draw on the root window. -mono Make all the rocks the same color. -ncolors colors How many different colors to use. Default 5. Colors are chosen randomly. -install Install a private colormap for the window. -visual visual Specify which visual to use. Legal values are the name of a visual class, or the id number (decimal or hex) of a specific visual. -count integer Maximum number of rocks to draw on the screen at once. Default 100. -speed integer A measure of the speed with which the observer and the rocks pass each other, from 1 to 100. Default 100, meaning ``very fast.'' If you're on a slow display connection (the animation looks jerky) then try making this number smaller, and/or decreasing the num- ber of rocks. -delay microseconds Number of microseconds to delay between each frame. Default 50000, meaning about 1/20th second. Compare and contrast with -speed, above. -norotate Don't rotate the observer; just fly through the field on the level. -nomove Don't turn the observer; just fly straight ahead through the field. -3d Do red/blue 3d separations: if you look at the screen with 3d glasses, the rocks will be jumping right out at you. Oooooh, scaaary! -fps Display the current frame rate and CPU load. ENVIRONMENT
DISPLAY to get the default host and display number. XENVIRONMENT to get the name of a resource file that overrides the global resources stored in the RESOURCE_MANAGER property. SEE ALSO
X(1), xscreensaver(1) BUGS
There should be an option to display doppler shift (a gravity rainbow.) Speed of rotation should be settable. Default speed of rotation should be relative to forward velocity. COPYRIGHT
Copyright (C) 1992 by Jamie Zawinski. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. AUTHOR
Based on Lisp Machine code copyright 1988 John Nguyen <johnn@hx.lcs.mit.edu>. Ported to C and X by Jamie Zawinski <jwz@jwz.org>, 13-aug-92. Steering code by Jeremie Petit; 3D code by theiling@coli.uni-sb.de. X Version 11 5.15 (28-Sep-2011) rocks(6x)
All times are GMT -4. The time now is 06:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy