Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Select only desired features from a textby remluvr (Sexton) |
on Mar 19, 2012 at 11:25 UTC ( [id://960394]=perlquestion: print w/replies, xml ) | Need Help?? |
remluvr has asked for the wisdom of the Perl Monks concerning the following question: Hi everyone. Here I am with a new problem I can't solve. I have two input files. One contains a list of semantic relations structured like the following (lets' call it INPUT1):
And another one that is like the following (obviously the following is just a very reduced version):
I need to check input1 for relations eq "coord" (third field of the rows) and search input2 for occurrences of fourth field of the row element in it. In this case I have crocodile-n and frog-n. I have to build another file that looks like input2 but contains every row whose first field is crocodile-n or frog-n. If one element is already found, I need not to repeat it, but sum the score it has with the one I already found. I understand this explanation is not really clear, so here it is an example of desired output:
I have no idea where to start. Less than one month since I started back using perl, and still a lot I have to learn Every suggestion, tip, indication on what to do would be really appreciated I need it because I'm analyzing some statistical measure to be used on semantic relation for my ph.D Theses. Thanks to all Giulia
Back to
Seekers of Perl Wisdom
|
|