print column value after exact match of variables in file
I have file like below
Code:
summit hvar_rgrpd_10d_hvams17_ _kgr_prod.rec checksum checksum us europe
summit hvar_rgrpd_10d_hvams17_ _kgr_prod.xml var summit us Europe
now I have two variables
Code:
hvar_rgrpd_10d_hvams17_ and _kgr_prod.xml
now I need to print column 6 if there is exact match for var1 and var2 for field 2 and field 3
like it should give me
Code:
US
whatever I'm trying it's always giving two records of US . but it should give me field 6 value of first row as field2 and field3 are exact match to var1 and var2.
I'm having problems since few days ago, and i'm not able to make it works with a simple awk+grep script (or other way to do this).
For example, i have a input file1.txt:
cat inputfile1.txt
218299910417
1172051195
1172070231
1172073514
1183135117
1183135118
1183135119
1281440202
... (3 Replies)
I am trying to match a pattern exactly in a shell script. I have tried two methods
awk '/\<mpath${CURR_MP}\>/{print $1 $2}' multipath
perl -ne '/\bmpath${CURR_MP}\b/ and print' /var/tmp/multipath
Both these methods require that I use the escape character. I am guessing that is why... (8 Replies)
Hi,
I have two files. 1st file has 1 column (huge file containing ~19200000 lines) and 2nd file has 2 columns (small file containing ~6000 lines).
#################################
huge_file.txt
a
a
ab
b
##################################
small_file.txt
a 1.5
b 2.5
ab ... (4 Replies)
I have in a file
domain.com. 1909 IN A 1.22.33.44
domain.com. 1909 IN A 22.33.44.55
ns1.domain.com. 1699 IN A 33.44.55.66
ns2.domain.com. 1806 IN A 77.77.66.66
I need to "grep" or "awk" out the lines starting with domain.com. as follows.
domain.com. 1909 IN A 1.22.33.44
domain.com.... (3 Replies)
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Hi experts,
I have a file with regexes which is used for automatic searches on several files (40+ GB).
To do some postprocessing with the grep result I need the matching line as well as the match itself.
I know that the latter could be achieved with grep's -o option. But I'm not aware of a... (2 Replies)
I have a file with class c IP addresses that I need to match to a column and print the matching lines of another file.
I started playing with grep -if file01.out file02.out but I am stuck as to how to match it to a column and print the matching lines;
cat file01.out
10.150.140... (5 Replies)
I am trying to create a cronjob that will run on startup that will look at a list.txt file to see if there is a later version of a database using database.txt as the source. The matching lines are written to output.
$1 in database.txt will be in list.txt as a partial match. $2 of database.txt... (2 Replies)
hi
I have 2 file with more than 10 columns for both
1st file
apple,0,0,0......
orange,1,2,3.....
mango,2,4,5.....
2nd file
apple,2,3,4,5,6,7...
orange,2,3,4,5,6,8...
watermerlon,2,3,4,5,6,abc...
mango,5,6,7,4,6,def.... (1 Reply)
Discussion started by: tententen
1 Replies
LEARN ABOUT SUNOS
volmgt_feature_enabled
volmgt_feature_enabled(3VOLMGT) Volume Management Library Functions volmgt_feature_enabled(3VOLMGT)NAME
volmgt_feature_enabled - check whether specific Volume Management features are enabled
SYNOPSIS
cc [ flag ... ] file ... -l volmgt [ library ... ]
#include <volmgt.h>
int volmgt_feature_enabled(char *feat_str);
DESCRIPTION
The volmgt_feature_enabled() routine checks whether specific Volume Management features are enabled. volmgt_feature_enabled() checks for
the Volume Management features passed in to it by the feat_str parameter.
Currently, the only supported feature string that volmgt_feature_enabled() checks for is floppy-summit-interfaces. The floppy-summit-
interfaces feature string checks for the presence of the libvolmgt routines volmgt_acquire() and volmgt_release().
The list of features that volmgt_feature_enabled() checks for is expected to expand in the future.
RETURN VALUES
0 is returned if the specified feature is not currently available. A non-zero value indicates that the specified feature is currently
available.
EXAMPLES
Example 1: A sample of the volmgt_feature_enabled() function.
In the following example, volmgt_feature_enabled() checks whether the floppy-summit-interfaces feature is enabled.
if (volmgt_feature_enabled("floppy-summit-interfaces")) {
(void) printf("Media Sharing Routines ARE present
");
} else {
(void) printf("Media Sharing Routines are NOT present
");
}
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level | MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO volmgt_acquire(3VOLMGT), volmgt_release(3VOLMGT), attributes(5)SunOS 5.10 13 Dec 1996 volmgt_feature_enabled(3VOLMGT)