#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    63
    Rep Power
    3

    Compare two files and fetch data


    Dear all

    I have two files to compare

    One file contains

    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1
    Muscarinic acetylcholine receptor M1



    Second file contains

    Muscarinic acetylcholine receptor _Name _Muscarinic acetylcholine receptor
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M2 _UniProt ID _P08172
    Muscarinic acetylcholine receptor M3 _UniProt ID _P20309
    Muscarinic acetylcholine receptor M4 _UniProt ID _P08173
    Muscarinic acetylcholine receptor M5 _UniProt ID _P08912
    Vascular endothelial growth factor receptor 1 _UniProt ID _P17948
    Vascular endothelial growth factor receptor 2 _UniProt ID _P35968
    Quote
    I have to check if there is completely common entries in the first column of both files than it should fetch the data in fornt of it

    so for above example expected output is

    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Muscarinic acetylcholine receptor M1 _UniProt ID _P11229
    Quote
    Kindly help me regarding this.
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    Pretty easy. All you have to do is use a lookup hash table and the split() function.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    63
    Rep Power
    3
    Hi

    Thanks for reply.

    Sorru but I never used lookuphash table in perl code

    I was doing this using unix code but did not wrk with this data because of similar entries.


    Mani
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Apr 2009
    Posts
    1,937
    Rep Power
    1225
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2012
    Posts
    832
    Rep Power
    496
    Originally Posted by manigrover
    Sorru but I never used lookuphash table in perl code
    Maybe it is time to start. You have been coming here (and at least one other forum) looking for Perl solutions for at least 18 months, you should be able to use a hash by now. When I took up Perl, it took me about 2 hours (actually, probably less) before I started to use hash tables.

IMN logo majestic logo threadwatch logo seochat tools logo