J
jamasd
Here is an example of the text I am running the program on (they are
separated by tabs):
1234123 jaesdf ytkyk 345234
1264345 ghgfdf ghjhg 657658
3456765 sdasdf ytkyk 456543
1231232 assffg werwe 123454
5447454 asdqfr ytkyk 254364
I would like to create hash that contains "ytkyk" and "ghjhg". The
program needs to read the hash and search only the third column for
similar text. If the column contains the text, the line (row) needs to
be printed.
Here is what I have so far. This program just reads the entire thing
and prints lines that match:
open( File, '<', location of file.txt' ) or die "$!\n";
while ( <File> ) {
next unless ( index($_, 'ytkyk') >= 0 );
next unless ( index($_, 'ghjhg') >= 0 );
print;
}
close( File );
Thank you very much
separated by tabs):
1234123 jaesdf ytkyk 345234
1264345 ghgfdf ghjhg 657658
3456765 sdasdf ytkyk 456543
1231232 assffg werwe 123454
5447454 asdqfr ytkyk 254364
I would like to create hash that contains "ytkyk" and "ghjhg". The
program needs to read the hash and search only the third column for
similar text. If the column contains the text, the line (row) needs to
be printed.
Here is what I have so far. This program just reads the entire thing
and prints lines that match:
open( File, '<', location of file.txt' ) or die "$!\n";
while ( <File> ) {
next unless ( index($_, 'ytkyk') >= 0 );
next unless ( index($_, 'ghjhg') >= 0 );
print;
}
close( File );
Thank you very much