Hi monks
My problem should be easy to solve, but I am still struggling very much to find a proper solution to it.
I have two txt fils containing two lists of words - one word per line - with a score (the score simply being the row number). I'd like to merge the two files, ordering the words according with a new ranking computed by multiplying the scores of the same word in the two files.
The files have the following format:
FILE 1 hello 1 today 2 well 3 yes 4
FILE 2 hello 1 yes 2 today 3 well 4
The output should look like:
hello 1 today 6 yes 8 well 12
I am by now reading FILE 1 line by line, reading through FILE 2 to match the same word, multiplying the scores and write the result out into a new file. As the list are huge, it seems to me a very BAD way to do this task. Any idea how I could do it better? Sorry if my question is too simple...
Thanks, Cla
In reply to Merging two list with simple operation by fanticla
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |