Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Comparing strings from different files

by Jalcock501 (Sexton)
on Oct 08, 2013 at 10:03 UTC ( #1057400=note: print w/ replies, xml ) Need Help??


in reply to Re: Comparing strings from different files
in thread Comparing strings from different files

Hi McA The records are the same it's just the Record labels that are slightly different:

FILE1: 99INSSCH|248| 99POLCOM|3||CAP01|66|3301R7435459||||| 99INSFAC2|MSRA01_ +1||||||"LNI10708"| FILE2: E99INSSCH|248| E99POLCOM|3||CAP01|66|3301R7435459||||| E99INSFAC2|MSRA +01_1||||||"LNI10708"|
Where it begins 99(label) or E99(label) that is a new record.

I need to compare the records (not the labels) but I'm not sure how.

Hope this clears things up a wee bit


Comment on Re^2: Comparing strings from different files
Download Code
Re^3: Comparing strings from different files
by hippo (Curate) on Oct 08, 2013 at 10:23 UTC
    1. Open file1 and read it in one record at a time
    2. Each record should be split into the label and the rest
    3. Make the label the hash key and the rest the hash value
    4. Close file1 and open file2 and read it in one record at a time
    5. Each record should be split into the label and the rest
    6. You now have two rows to compare (the current record from file2 and the one stored in the hash keyed on the label from file1), so do that for whatever "compare" means in your task
    7. Close file2

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1057400]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2014-09-22 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (182 votes), past polls