Sponsored Content
Top Forums UNIX for Dummies Questions & Answers matching each line in a column to an array Post 302257171 by greptastic on Tuesday 11th of November 2008 02:42:50 PM
Old 11-11-2008
Thanks so much! It worked but, only returned one of the matches between file 1 and 2 , and I know there are many more. Any idea why it's not returning all of them?
Thanks again
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl array matching between area code and no.

Hi Everyone, I have: my @No=qw(032106 032630 0380 034010 035110 0354801111); my $str_No=join(';', @No); I have a string $strA="03263033", so in order to determine this $strA area code matches with @No, I can do: if ( (rindex($str_No,substr($strA,0,5))))== -1) ) { print "Not... (1 Reply)
Discussion started by: jimmy_y
1 Replies

2. Shell Programming and Scripting

Matching part of a string that is in an array

I am trying to do a comparison to see if these two string arrays match. I have tried assigning the array variable to another variable to get it to work but i can't figure it out. Here is what I have. #example of items that could be in the array #string="TEST"... (3 Replies)
Discussion started by: zatarra777
3 Replies

3. Shell Programming and Scripting

perl: array matching

Hi, I have two files like this file 1: xxtcgtatccgaggga cgcgcgggggagg jjsjjjjsjjjdtcgtat aaaaaaacccaaan ggtcgtatffaadda gggctggalllslllssdkk file 2: tcgtat gctggaI want to 1) match each element of file2 to each element of file1. 2) delete all the matched alphabets and subsequent... (3 Replies)
Discussion started by: polsum
3 Replies

4. Shell Programming and Scripting

1st column,2nd column on first line 3rd,4th on second line ect...

I need to take one column of data and put it into the following format: 1st line,2nd line 3rd line,4th line 5th line,6th line ... Thanks! (6 Replies)
Discussion started by: batcho
6 Replies

5. Shell Programming and Scripting

Insert lines above matching line with content from matching

Hi, I have text file: Name: xyz Gender: M Address: "120_B_C; ksilskdj; lsudlfw" Zip: 20392 Name: KLM Gender: F Address: "65_D_F; wnmlsi;lsuod;,...." Zip:90233I want to insert 2 new lines before the 'Address: ' line deriving value from this Address line value The Address value in quotes... (1 Reply)
Discussion started by: ysrini
1 Replies

6. Shell Programming and Scripting

Find lines with matching column 1 value, retain only the one with highest value in column 2

I have a file like: I would like to find lines lines with duplicate values in column 1, and retain only one based on two conditions: 1) keep line with highest value in column 3, 2) if column 3 values are equal, retain the line with the highest value in column 4. Desired output: I was able to... (3 Replies)
Discussion started by: pathunkathunk
3 Replies

7. Shell Programming and Scripting

Compare file1 for matching line in file2 and print the difference in matching lines

Hello, I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from... (2 Replies)
Discussion started by: RasB15
2 Replies

8. Shell Programming and Scripting

Matching column then append to existing File as new column

Good evening I have the below requirements, as I am not an experts in Linux/Unix and am looking for your ideas how I can do this. I have file called file1 and file2. I need to get the second column which is text1_random_alphabets and find that in file 2, if it's exists then print the 3rd... (4 Replies)
Discussion started by: mychbears
4 Replies

9. Shell Programming and Scripting

Matching column value from 2 different file using awk and append value from different column

Hi, I have 2 csv files. a.csv HUAWEI,20LMG011_DEKET_1296_RTN-980_IDU-1-11-ISV3-1(to LAMONGAN_M),East_Java,20LMG011_DEKET_1296_RTN-980_IDU-1,20LMG011,20LMG 027_1287_LAMONGAN_RTN980_IDU1,20LMG027,1+1(HSB),195.675,20LMG011-20LMG027,99.9995,202.6952012... (7 Replies)
Discussion started by: tententen
7 Replies

10. Shell Programming and Scripting

Replace Value of nth Column of Each Line Using Array

Hello All, I am writing a shell script with following requirement: 1. I have one input file as below CHE01,A,MSC,INO CHE02,B,NST,INC CHE03,C,STM,INP 2. In shell script I have predefined array as below: Array1={A, B, C} Array2= {U09, C04, A054} (6 Replies)
Discussion started by: angshuman
6 Replies
EvmFilterCreate(3)					     Library Functions Manual						EvmFilterCreate(3)

NAME
EvmFilterCreate(), EvmFilterDestroy(), EvmFilterIsFile(), EvmFilterReadFile(), EvmFilterSet(), EvmFilterTest() - event filter evaluator routines SYNOPSIS
Library EVM Support Library Parameters filter_evaluator For filter_evaluator is the return handle of an established filter evaluator. For filter_evaluator , identifies the filter evaluator that uses the filter_string in subsequent matches. For filter_evaluator identifies the filter evaluator that compares the supplied event with the filter string. For filter_evaluator identifies the filter evaluator to be destroyed. filter_string The filter string used by the filter evaluator in subsequent matches. See the EvmFilter(5) manpage for the syntax. event The event to be compared with the filter string currently associated with the filter evaluator. matchFlag The result obtained when the supplied event is compared with the filter string currently associated with the filter evalu- ator. Possible return values are as follows: The event matches the filter_string. The event does not match the filter_string. DESCRIPTION
The filter evaluation routines check whether an event matches a given event filter. These functions are useful to clients that pass a com- plex filter to the EVM daemon. Then the clients test incoming events against subcomponents of the filter to determine the appropriate action. The routine establishes an instance of a filter evaluator, returning a handle in filter_evaluator. The routine passes a filter_string to the filter_evaluator for subsequent matches. The routine compares the supplied event with the filter_string currently associated with the filter_evaluator. The result is returned in matchFlag. Possible return values are as follows: The event matches the filter_string. The event does not match the filter_string. The indirect filter syntax, is supported by the and routines. Programs which support indirect filters may use to determine whether a user- supplied filter string is indirect. If so, then use to expand the file to a regular filter string. returns if the supplied filter_string uses indirect filter notation, and returns otherwise. interprets the supplied filter_string, and attempts to open and read the referenced file. returns a pointer to heap space memory contain- ing the expanded filter string. The caller is responsible for freeing the memory when it is no longer needed. NULL is returned if an error occurs while reading the file. Note that does not attempt to validate the filter string contained in the file. The routine destroys the filter_evaluator, freeing all associated resources. RETURN VALUE
The operation completed without error. A filter string that is syntactically invalid passed to the filter evaluator. One of the arguments to the function is invalid. A value in a structure member is invalid. An operation failed because an attempt to acquire heap memory failed. An attempt was made to use a filter evaluator without first calling which provides an initial filter string. An attempt to read a filter file failed. ERRORS
The value of is not set. SEE ALSO
Event Management EVM(5). EVM Events EvmEvent(5). Event Filter EvmFilter(5). EvmFilterCreate(3)
All times are GMT -4. The time now is 02:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy