Jump to content

Recommended Posts

Posted (edited)

I have two files. FILEA has data in the following format:

word1 2

word2 4

word3 1

The first column is the word to search for. The second is a value assigned to that word.

FILEB is a text copy of an email.

What I would like, is for the script to search the email for word1, word2, etc. I would then like a third file created that shows:

word1 3 6

word3 1 1

Total: 7

The words listed are the ones from FILEA found in FILEB. It shows that there were 3 instances of word1 in FILEB for a total value of 6 points. The total at the bottom of the file is the total value of all words from FILEA found in FILEB.

Can any one help me please?!?

Edited by mainemojo

Posted

Hmmm, this looks suspiciously like a homework assignment.

But to get you started, at what I would do. If FILEA is always paired items read them into a Dictionary object. Then read FILEB and search the dictionary object for the returned word and create your result list from the results in either an array or Dictionary.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...