Many thanks for your reply, i have tested with my simple data and it is woking perfect. I will be testing with some complex data and if i stuck with something i will get back to forum.
Many thanks
---------- Post updated at 05:57 PM ---------- Previous update was at 01:43 PM ----------
Hello,
I was testing some more data and found some more problem, the code is below.Assume we got 3 attribute. At second attribute, there are some data(eg.A41/A6) missing like at the fourth and six line
if there is no data missing, when i use the code
it is working perfect and printing all line number at cursor postion 9.
But if there is missing data at second or third attribute,the output data mess up like that
I have a file such as:
.....12345......67890...xxx
....123456....78901...yyy
...1234567...89012...zzz
..12345678.90123...aaa
Where the '.' character is a SPACE.
I'm trying to print just the first number in each line.
such as:
12345
123456
1234567
12345678
Both the number of... (1 Reply)
Hi Unix gurus
Basically i am searching for the pattern and getting the line numbers of the grepped pattern. I am trying to print the series of lines from 7 lines before the grepped line number to the grepped line number.
I am trying to use the following code. but it is not working.
cat... (3 Replies)
Hi,
I want to print the line number with the pattern of the line on a same line using multi-patterns in sed.
But i don't know how to do it.
For example, I have a file
abc
def
ghi
I want to print
1 abc
2 def
3 ghi
I know how to write it one line code, but i don't know how to put... (11 Replies)
Hi,
Please suggest a way to print number of words in the end of each line.
<input file>
red aunt house
blue sky
bat and ball game
<output file>
red aunt house 3
blue sky 2
bat and ball game 4
Thanks! (2 Replies)
I am looking for equivalent of following awk command in perl
# awk '{ print NF ":" $0 } ' junk1
8:VAH NIC_TYPE CONFIG SIZE_GB PILO KOM BHA_GRP DESCR
8:2 NIC6 cont 34 y n shal_orgrp /shal
8:4 NIC5 signa 52 n y shal_orgrp... (3 Replies)
Hi,
Anyone help me to print the lines from the flat file between 879th line number and 1424th line number.
The 879 and 1424 should be passed as input to the shell script(It should be dynamic).
Can any one give me using sed or awk?
I tried using read, and print the lines..Its taking too... (3 Replies)
how i need help again
i have file input.txt like this
48:20111008_20111122:31231|123|
78:20111008_20111122:435453|321112|
where 48 and 78 is line number 20111008_20111122 is a file and 31231|123| i want get in file, i am using manual awk for get that file like this
awk 'NR==48... (6 Replies)
Hi,
I have below text file
wer,r5yut,dfy5y,dytry
w45w,vbjjbh,xfsd,ctfyuk
xdte56,rty6r,r645,976fd
w34r,dtyer,d5tyty,fdyrt
I want to get an O/P the enter rows for example if I enter 2, the first row should print
output
wer,r5yut,dfy5y,dytry
w45w,vbjjbh,xfsd,ctfyuk (4 Replies)
Hi
I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field.
The source file is pipe delimited and looks something like
1|net|ABC Letr1|1530|||
1|net|EXP_1040 ABC|1121|||
1|net|EXP_TG1224|1122|||
1|net|R_North|1123|||... (5 Replies)
Discussion started by: Mudshark
5 Replies
LEARN ABOUT BSD
genders_testattr
GENDERS_TESTATTR(3) LIBGENDERS GENDERS_TESTATTR(3)NAME
genders_testattr - test if a node has an attribute
SYNOPSIS
#include <genders.h>
int genders_testattr(genders_t handle, const char *node, const char *attr, char *val, int len);
int genders_testattrval(genders_t handle, const char *node, const char *attr, const char *val);
DESCRIPTION
genders_testattr() tests if the node pointed to by node contains the attribute pointed to by attr. If node is NULL, the current node is
tested. If the attribute is found, its value is stored in the buffer pointed to by val. len should indicate the length of the buffer. If
the attribute value is not needed, val can be set to NULL.
To avoid passing in an attribute value buffer that is not large enough to store the attribute value, genders_getmaxvallen(3) should be used
to determine the minimum buffer size that should be used.
genders_testattrval() tests if the node pointed to by node contains the attribute pointed to by attr and if that attribute is equal to the
attribute value pointed to by val. If val is NULL, only the attribute is tested.
RETURN VALUES
For genders_testattr(), if the node contains the attribute, 1 is returned. 0 is returned if the node does not contain the attribute.
For genders_testattrval(), if the node contains the attribute and it is equal to the attribute value, 1 is returned. 0 is returned if the
node does not contain the attribute, or if the attribute is not equal to the attribute value.
For both genders_testattr() and genders_testattrval(), -1 is returned on error, and an error code is returned in handle. The error code
can be retrieved via genders_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_NOTLOADED
genders_load_data(3) has not been called to load genders data.
GENDERS_ERR_OVERFLOW
The buffer pointed to by val is not large enough to store the attribute value.
GENDERS_ERR_PARAMETERS
An incorrect parameter has been passed in.
GENDERS_ERR_NOTFOUND
The node pointed to by node cannot be found in the genders file or if node=NULL, the machine genders is running on is not listed in
the genders database.
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).
FILES
/usr/include/genders.h
SEE ALSO libgenders(3), genders_handle_create(3), genders_load_data(3), genders_getmaxvallen(3), genders_errnum(3), genders_strerror(3)LLNL August 2003 GENDERS_TESTATTR(3)