Hi,
I have a file which contains records of data.
I need to split the file into multiple files depending upon the value of last field.
How do i read the last field of each record in the file???
Regards,
Chaitrali (4 Replies)
I have a file ehich has multiple create statements as
create abc 123
one
two
create xyz 456
four
five
create nnn 666
six
four
I want to separte each create statement in seperate files (3 Replies)
Hi,
i have a file like this:
1|2|3|4|5|
1|2|8|4|6|
Trailer1|||||
1|2|3|
Trailer2|||
3|4|5|6|
3|4|5|7|
3|4|5|8|
Trailer2|||
I want to generate 3 files out of this based on the trailer record. Trailer record string can be different for each file or it may be same for one or two.
No... (24 Replies)
I want a script that will add comments to a file before check-in files. comments depend on type of files.
i have a script to list files in the directory that will be checked-in
There are xml, js, html, vm files. vm will use comments like c/c++ ( // or /*..*/)
can you help me add a comment line... (0 Replies)
Hi,
I have a data file xyz.dat similar to the one given below,
2345|98|809||x|969|0
2345|98|809||y|0|537
2345|97|809||x|544|0
2345|97|809||y|0|651
9685|98|809||x|321|0
9685|98|809||y|0|357
9685|98|709||x|687|0
9685|98|709||y|0|234
2315|98|809||x|564|0
2315|98|809||y|0|537... (2 Replies)
Hi,
I have a file of the following syntax that has around 120K records that are tab separated.
input.txt
abc def klm 20 76 . + . klm_mango unix_00000001;
abc def klm 83 84 . + . klm_mango unix_0000103;
abc def klm 415 439 . + . klm_mango unix_00001043;
I am looking for an awk oneliner... (2 Replies)
Hi ,
I do have a fixedwidth flatfile that has data for 10 different datasets each identified by the first two digits in the flatfile.
01 in the first two digit position refers to Set A
02 in the first two digit position refers to Set B and so on
I want to genrate 10 different files from my... (6 Replies)
Hi ,
my file look likes below ,
cat file.csv
12/09/2014,50,5,0,300
12/09/2014, ,5,0,300
12/09/2014,50,,,300
i need to split file , the first one contains values (2nd column is 50 , 3rd and fourth column is null )
the second file contains all others
firstfile
... (2 Replies)
I would like some advice on some code.
I want to write a small script that will take an input file of this format
111222233334444555666661112222AAAA
2222333445556612323244455445454545
2334556345643534505435345353453453
(and so on)
It will be called as : script inputfile X (where X is... (5 Replies)
Discussion started by: onlyforbopi
5 Replies
LEARN ABOUT LINUX
inet_ntop
INET_NTOP(3) Linux Programmer's Manual INET_NTOP(3)NAME
inet_ntop - convert IPv4 and IPv6 addresses from binary to text form
SYNOPSIS
#include <arpa/inet.h>
const char *inet_ntop(int af, const void *src,
char *dst, socklen_t size);
DESCRIPTION
This function converts the network address structure src in the af address family into a character string. The resulting string is copied
to the buffer pointed to by dst, which must be a non-NULL pointer. The caller specifies the number of bytes available in this buffer in
the argument size.
inet_ntop() extends the inet_ntoa(3) function to support multiple address families, inet_ntoa(3) is now considered to be deprecated in
favor of inet_ntop(). The following address families are currently supported:
AF_INET
src points to a struct in_addr (in network byte order) which is converted to an IPv4 network address in the dotted-decimal format,
"ddd.ddd.ddd.ddd". The buffer dst must be at least INET_ADDRSTRLEN bytes long.
AF_INET6
src points to a struct in6_addr (in network byte order) which is converted to a representation of this address in the most appropri-
ate IPv6 network address format for this address. The buffer dst must be at least INET6_ADDRSTRLEN bytes long.
RETURN VALUE
On success, inet_ntop() returns a non-NULL pointer to dst. NULL is returned if there was an error, with errno set to indicate the error.
ERRORS
EAFNOSUPPORT
af was not a valid address family.
ENOSPC The converted address string would exceed the size given by size.
CONFORMING TO
POSIX.1-2001. Note that RFC 2553 defines a prototype where the last argument size is of type size_t. Many systems follow RFC 2553. Glibc
2.0 and 2.1 have size_t, but 2.2 and later have socklen_t.
BUGS
AF_INET6 converts IPv4-mapped IPv6 addresses into an IPv6 format.
EXAMPLE
See inet_pton(3).
SEE ALSO getnameinfo(3), inet(3), inet_pton(3)COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2008-11-11 INET_NTOP(3)