Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Comparing strings from different files

by McA (Priest)
on Oct 08, 2013 at 09:50 UTC ( #1057397=note: print w/replies, xml ) Need Help??


in reply to Comparing strings from different files

You don't need a script. One look showed me: They are different...

Of course just kidding: You have to explain when two files are equal and when they are different. Where are the records, where are the fields? Even the field names seem to be different.

McA

  • Comment on Re: Comparing strings from different files

Replies are listed 'Best First'.
Re^2: Comparing strings from different files
by Jalcock501 (Sexton) on Oct 08, 2013 at 10:03 UTC
    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
      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://1057397]
help
Chatterbox?
[karlgoethebier]: ... the ultimate coding experience for everyday people...
[karlgoethebier]: ...like me
[marto]: what a mess
[karlgoethebier]: perhaps i need a zerial?
[Corion]: marto: Heh - I think that's a nice contractual trap, "you will not use other gods/engines besides ours" ;)
[Corion]: But if the base intention was to have CIG as "co-developers" who (have to) contribute changes back to the mainline, it makes sense to have them use no other engine
[marto]: yes, I hear that development house has been on its last legs for a couple of years now
[Corion]: Is anybody aware of what makes Android Oreo better than Android Nougat? I'm not sure if the architectural changes (etc) are there already that make upgrading an Oreo-kernel phone to a newer Android userland (Lineage OS) version feasible
[Corion]: Yeah, CryTek got blindsided (or whatever) by Unity and Unreal Engine being zero cost, and the CryTek documentation being bad/nonexistent I think
[Corion]: "zero monetary cost", because of course, it's gratis only if your time has no value :)

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2017-12-14 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (389 votes). Check out past polls.

    Notices?