I am trying to wrap my head around a couple of problems, so I thought I would see if anyone here in the monastery could give me some advice.
I am trying to scrape a webpage to remove a username and the ip address associated with it. There are multiple username/ip address pairings on the page. This information will then be inserted into a database. The problem that I will run into though is that the same username and ip will undoubtably be on the page more than one time. In order to make sure that only one pairing of information is inserted into the database, wouldn't I want to insert the scraped information into a hash or array before doing a database insert so I could somehow remove duplicates? I am not sure how to go about this.
Do I use a hash, or an array? Can I use a regular expression to add the username ip address pair of data to a hash and then remove duplicates? Is this how it should be done? I am really confused.
I appreciate everyone's help and thanks in advance.
--ghettofingerIn reply to Using hashes or arrays to remove duplicate entries by ghettofinger
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |