hi
i am a new unix user
i want to check whether a file contains spacefied no of fields
if so i should delete last fields
and then insert some fields in 2nd field
please help me
Thanks Regards
babu :mad: (7 Replies)
Dear All ,
I have the query
cat temp.txt
|28-07-1997|IF_LEG_DCCT|TOV JV sdfsdfdsfdsfdsCLOSED* KIEV|381015280
I need to count the number of fields in this pipe-seperated file. I beleive this is possible via AWK command.
The in above file, output of the count should be 5....
Can some-one... (5 Replies)
Dear All,
Please help me to do this.
I have a file like this.
5|94662240807|94776109911|94776325901|94779007172||||||
5|94112925421|94352240384|94352259199|94672229012||||||
5|94714242745|94722952461|94777660793|94788914465||||||
5|94242224624|94776145420|94776172499|94776531059||||||
... (7 Replies)
I have . dat file which contains data in a specific format:
0 3 892 921 342
1 3 921 342 543
2 4 817 562 718 765
3 3 819 562 717 761
i need to compare each field in a row with another field of the same column but different row and cont the... (8 Replies)
Hi
I was going through the below thread
https://www.unix.com/shell-programming-scripting/48535-how-count-number-fields-record.html
I too have something similar requirement as specified in this thread but the number of columns in my case can be very high, so I am getting following error.
... (3 Replies)
Hi,
I used to count number of fields using following command head -1 <filename> | awk -F"," '{print NF}'
Now the scenario is the delimiter(comma) occurs inside one of the data field. How to ignore the comma inside data and consider only delimiter and count number of fields. The fields are... (1 Reply)
Hello All,
I got a requirement when I was working with a file. Say the file has unloads of data from a table in the form
1|121|asda|434|thesi|2012|05|24|
1|343|unit|09|best|2012|11|5|
I was put into a scenario where I need the field count in all the lines in that file. It was simply... (6 Replies)
Hi,
i am trying to count the fields in a file.
Input:
100,1000,,2000,3000,10/26/2012 12:12:30
200,3000,,1000,01/28/2012 17:12:30
300,5000,,5000,7000,09/06/2012 16:12:30
output:
Cout of the fileds for each row
6
5
6
awk -F"," '{print $NF}' file1.txt
When i try with above awk... (3 Replies)
Hello All,
I am trying a one liner for finding the number of null columns in every line of my flat file.
The format of my flat file is like this
a|b|c|d||||e|f|g|
a|b|c|d||||e|f|g|
I want to count the number of fields delimited by "|" which are blank.
In above case the count should be... (6 Replies)
I am new to cut and I want to use the field option with a space delimiter on an Apache log file.
For example, if I wanted to find the 200 HTTP code using cut in this manner on the file below
cat access_abc.log | cut -d' ' -f7 | grep "200"
157.55.39.183 - - "GET /content/696-news041305... (4 Replies)
Discussion started by: sharingsunshine
4 Replies
LEARN ABOUT FREEBSD
realhostname
REALHOSTNAME(3) BSD Library Functions Manual REALHOSTNAME(3)NAME
realhostname -- convert an IP number to the real host name
LIBRARY
System Utilities Library (libutil, -lutil)
SYNOPSIS
#include <libutil.h>
int
realhostname(char *host, size_t hsize, const struct in_addr *ip);
DESCRIPTION
The function realhostname() converts ip to the corresponding host name. This is done by resolving ip to a host name and then ensuring that
the host name resolves back to ip.
host must point to a buffer of at least hsize bytes, and will always be written to by this function.
If the name resolution does not work both ways or if the host name is longer than hsize bytes, inet_ntoa(3) is used to convert ip to an ASCII
form.
If the string written to host is hsize bytes long, host will not be NUL terminated.
RETURN VALUES
The realhostname() function will return one of the following constants which are defined in <libutil.h>:
HOSTNAME_FOUND
A valid host name was found.
HOSTNAME_INCORRECTNAME
A host name was found, but it did not resolve back to the passed ip. host now contains the numeric value of ip.
HOSTNAME_INVALIDADDR
ip could not be resolved. host now contains the numeric value of ip.
HOSTNAME_INVALIDNAME
A host name was found, but it could not be resolved back to any ip number. host now contains the numeric value of ip.
SEE ALSO gethostbyaddr(3), gethostbyname(3), inet_ntoa(3), realhostname_sa(3)BSD April 6, 1999 BSD