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, EvmFilterSet, EvmFilterTest, EvmFilterIsFile, EvmFilterReadFile, EvmFilterDestroy - Event filter evaluator routines LIBRARY
EVM Support Library (libevm.so, libevm.a) SYNOPSIS
#include <evm/evm.h> EvmStatus_t EvmFilterCreate ( EvmFilter_t *filter_evaluator); EvmStatus_t EvmFilterSet ( EvmFilter_t filter_evaluator, const EvmString_t filter_string); EvmStatus_t EvmFilterTest ( EvmFilter_t filter_evaluator, EvmEvent_t event, EvmBoolean_t *matchFlag); EvmBoolean_t EvmFilterIsFile ( const char *filter_string); char * EvmFilterReadFile ( const char *filter_string); EvmStatus_t EvmFilterDestroy ( EvmFilter_t filter_evaluator); OPERANDS
For EvmFilterCreate() this is the return handle of the instance of a filter evaluator established. For EvmFilterSet() this identifies the filter evaluator that will use the filter_string in subsequent matches. For EvmFilterTest() this identifies the filter evaluator that will compare the supplied event with the filter string. For EvmFilterDestroy() this identifies the filter evaluator to be destroyed. The filter string to be used by the filter evaluator in subsequent matches. See the EvmFilter(5) reference page for the syntax. The event to be compared with the filter string cur- rently associated with the filter evaluator. The result obtained when the supplied event is compared with the filter string cur- rently associated with the filter evaluator. 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 are used to check whether an event matches a given event filter. Although most EVM clients do not need to use these functions directly, they are useful to clients that pass a complex filter to the EVM daemon, and then test incoming events against subcomponents of the filter to determine the appropriate action. The EvmFilterCreate() routine establishes an instance of a filter evaluator, returning a handle in filter_evaluator. The EvmFilterSet() routine passes a filter_string to the filter_evaluator to be used in subsequent matches. The EvmFilterTest() 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 fil- ter_string. The indirect filter syntax, @filename, is supported by the EvmFilterIsFile() and EvmFilterReadFile() routines. Programs which support indirect filters may use EvmFilterIsFile() to determine whether a user-supplied filter string is indirect, and, if so, can then use EvmFil- terReadFile() to expand the file to a regular filter string. EvmFilterIsFile() returns EvmTRUE if the supplied filter_string uses indirect filter notation, and EvmFALSE otherwise. EvmFilterReadFile() interprets the supplied filter_string, and attempts to open and read the referenced file, returning a pointer to heap space memory containing the expanded filter string. The caller is responsible for freeing the memory when it is no longer needed. NULL is returned if an error was encountered while reading the file. Note that EvmFilterReadFile() does not attempt to validate the filter string contained in the file. The EvmFilterDestroy() routine destroys the filter_evaluator, freeing all associated resources. RESTRICTIONS
None RETURN VALUES
The operation was completed without error. A filter string passed to the filter evaluator was syntactically invalid. One of the arguments to the function was 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 EvmFilterSet() to provide an initial filter string. A filter string passed to the filter evaluator was syntactically invalid. An attempt to read a filter file failed. ERRORS
None FILES
None SEE ALSO
Event Management: EVM(5) EVM Events: EvmEvent(5) Event Filter: EvmFilter(5) delim off EvmFilterCreate(3)
All times are GMT -4. The time now is 08:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy