Just in case, be aware that should a blank line occurr in the data, the initial value of i will be greater than NF and the highlighted expression will never be true, an infinite loop (or at least a loop that runs until a field size limit is triggered by $i). Using < should fix it.
Hi,
I have an urgent task here. I am required to sort a flat file based on multiple columns which are based on the character position in that line. I am restricted to use the character position instead of the space and sort +1 +2 etc to do the sorting.
I understand that there is a previous... (8 Replies)
I need to find the line count of multiple strings in a particular file. The strings are as follows:
bmgcc
bmgccftp
bsmsftp
bulkftp
cctuneftp
crbtftp
crmpos
cso
gujhr
I am doing manual grep for each of the string to find the line count. The command i am using right now is:
grep mark... (3 Replies)
Hello,
I would like to find an efficient way to compare a pair of strings that differ at one position, and return the difference and position.
For example:
String1 123456789
String2 123454789
returning something - position 6, 6/4
Thanks in advance,
Mike (5 Replies)
Hi,
I need to search for some strings in specific positions in a file.
If the strings: "foo1", "foo2" or "foo3" is on position 266 or position 288 in a file i want the whole line printed.
Any idea how to do it? (5 Replies)
How to extract multiple data based on character position. I need to fetch from 7-9 and 22-26 and there is no delimiter for 22-26 since it is part of the column. The file may have more than 1000 character long.I managed to pull any one but not both
for example
test data
12345 zxc vbnmlk... (1 Reply)
I want to search files (basically .cc files) in /xx folder and subfolders.
Those files (*.cc files) must contain #include "header.h" AND x() function.
I am writing it another way to make it clear,
I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Hi,
i want find the character '-' in a file from position 284-298, if it occurs i need to replace it with 'O ' for the position in the file. How to do that using SED command.
thanks in advance,
Sara (9 Replies)
Hi Guys!
Could anyone help me with?..
I have a line which says
BCVGF%6$#900 .....How can we know which position is for % or say $ by command or script?There is any way to get a prompt by any script?
Thanks a lot (6 Replies)
Hello,
I have spent considerable amount of time breaking my head on this and reached out here. here is the back ground.
OS - Solaris 10
There are two strings '<Orin>sop' and '<Dup>two' which I wanted to look for in a file without the quotes on different lines and ONLY if both strings are... (5 Replies)
Discussion started by: keithTait309875
5 Replies
LEARN ABOUT DEBIAN
getnodebyaddr
GETNODEBYADDR(3) Library Functions Manual GETNODEBYADDR(3)NAME
getnodebyaddr - DECnet node entry retrieval by address
SYNOPSIS
#include <netdnet/dn.h>
#include <netdnet/dnetdb.h>
struct nodeent *getnodebyaddr (char *addr, short len, const int family)
DESCRIPTION
getnodebyaddr searches the decnet hosts file for the DECnet node with address equal to addr of len bytes, belonging to protocol family fam-
ily (PF_DECnet) and returns node information into the nodeent structure.
If no entry is found, returns NULL
EXAMPLE
#include <netdnet/dn.h>
#include <netdnet/dnetdb.h>
#include <sys/socket.h>
main(void)
{
struct dn_naddr binaddr;
struct nodeent *dp;
binaddr->a_len = 2;
binaddr->a_addr[0] = 0x02;
binaddr->a_addr[1] = 0x04;
if ( (dp=getnodebyaddr(binaddr->a_addr,binaddr->len, PF_DECnet)) == NULL)
printf("Error, cannot find node entry");
else
printf("Node name is %s",dp->n_name);
}
SEE ALSO dnet_htoa(3), dnet_ntoa(3), dnet_conn(3), dnet_addr(3), getnodebyname(3), getnodeadd(3), setnodeent(3)DECnet database functions July 28, 1998 GETNODEBYADDR(3)