gives the result without the filename, because wc is reading from stdin.
{n++} - for every line read from input, add one to n. The first time n is encountered it is assumed to be zero.
END{} runs after all of the lines in the file have been read.
Hi,
Is it possible to find the total number of records processed by awk at begining.
NR gives the value at the end. Is there any variable available to find the value at the begining?
Thanks
----------
Suman (1 Reply)
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)
Hi everyone.
I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this:
ID: 20
Name: X
Age: 19
ID: 21
Name: Z
ID: 22
Email: xxx@yahoo.com
Name: Y
Age: 19
I want to grep records that... (4 Replies)
Hi All,
I want to find the number of records in a file of a particular directory
I have a file as abcd.txt in the path
var/hr/payments/
I want to find number of records in abcd.txt file in a single command.
I tried the following
cd /var/hr/payments/wc -l abcd.txt
I got... (5 Replies)
Hi all
Thanks in advance...........
Please help me for this issue............
I have a file it has 11 records . I used the command like ....
>$ wc -l file
11 file
I'm getting output like 11 file (no.of records along with filename)
here my requirement is, I want to display only... (3 Replies)
Hi,
I have a comma (,) delimited file, in which few fields are enclosed with in double quotes " ". I have to print the records in the file which donot have expected number of field with the line number.
File1
====
name,desgnation,doj,project #header#... (7 Replies)
I have 2 files
"File 1" is delimited by ";" and "File 2" is delimited by "|".
File 1 below (3 record shown):
Doc1;03/01/2012;New York;6 Main Street;Mr. Smith 1;Mr. Jones
Doc2;03/01/2012;Syracuse;876 Broadway;John Davis;Barbara Lull
Doc3;03/01/2012;Buffalo;779 Old Windy Road;Charles... (2 Replies)
I would like to print the number of records of 2 files, and divide the two numbers
awk '{print NR}' file1 > output1
awk '{print NR}' file2 > output2
paste output1 output2 > output
awl '{print $1/$2}' output > output_2
is there a faster way? (8 Replies)
Given a file like this:
abc
def
ghi
I need to get to
somestandardtext abc1 morestandardtext
somestandardtext def2 morestandardtext
somestandardtext ghi3 morestandardtext
Notice that in addition to the standard text there is the line number added in as well. What I conceived is... (4 Replies)
Hi Freinds ,
I have 2 files .
File 1
|nag|HYd|1|Che
|esw|Gun|2|hyd
|pra|bhe|3|hyd
|omu|hei|4|bnsj
|uer|oeri|5|uery
File 2
|nag|HYd|1|Che
|esw|Gun|2|hyd
|uer|oi|3|uery
output : (9 Replies)
Discussion started by: i150371485
9 Replies
LEARN ABOUT OSX
genders_load_data
GENDERS_LOAD_DATA(3) LIBGENDERS GENDERS_LOAD_DATA(3)NAME
genders_load_data - read and parse a genders file
SYNOPSIS
#include <genders.h>
int genders_load_data(genders_t handle, const char *filename);
DESCRIPTION
genders_load_data() read and parses the genders file indicated by filename. If filename is NULL, genders_load_data() will attempt to read
and parse the default genders file defined by DEFAULT_GENDERS_FILE. handle is a genders handle created by genders_handle_create(3).
After genders_load_data() is called, information about the genders file is stored in the genders handle passed in. This information is
used by other genders C API functions. All future use of handle with other genders C API functions will be directly associated with the
genders file indicated by filename (or the default genders file if filename is NULL).
RETURN VALUES
On success, 0 is returned. On error, -1 is returned, and an error code is returned in handle. The error code can be retrieved via gen-
ders_errnum(3) , and a description of the error code can be retrieved via genders_strerror(3). Error codes are defined in genders.h.
ERRORS
GENDERS_ERR_NULLHANDLE
The handle parameter is NULL. The genders handle must be created with genders_handle_create(3).
GENDERS_ERR_OPEN
The genders file indicated by filename cannot be opened for reading.
GENDERS_ERR_READ
Error reading the genders file indicated by filename.
GENDERS_ERR_PARSE
The genders file indicated by filename is incorrectly formatted.
GENDERS_ERR_ISLOADED
genders_load_data(3) has already been called with handle.
GENDERS_ERR_OVERFLOW
A line in the genders database exceeds the maximum allowed length.
GENDERS_ERR_OUTMEM
malloc(3) has failed internally, system is out of memory.
GENDERS_ERR_MAGIC
handle has an incorrect magic number. handle does not point to a genders handle or handle has been destroyed by genders_han-
dle_destroy(3).
GENDERS_ERR_INTERNAL
An internal system error has occurred.
FILES
/usr/include/genders.h
SEE ALSO libgenders(3), genders_handle_create(3), genders_handle_destroy(3), genders_errnum(3), genders_strerror(3)LLNL August 2003 GENDERS_LOAD_DATA(3)