clarification

Thomas Jollans thomas at jollans.com
Fri Aug 17 07:17:37 EDT 2007


On Friday 17 August 2007, Beema shafreen wrote:
> hi everybody,
> i have a file with data separated by tab
> mydata:
> fhl1    fkh2
> dfp1    chk1
> mal3    alp14
> mal3    moe1
> mal3    spi1
> mal3    bub1
> mal3    bub3
> mal3    mph1
> mal3    mad3
> hob1    nak1
> hob1    wsp1
> hob1    rad3
> cdr2    cdc13
> cdr2    cdc2
> shows these two are separated by tab represented as columns
> i have to check the common data between these two coloumn1 an coloumn2
> my code:
> data = []
> data1 = []
> result = []
> fh = open('sheet1','r')
> for line in fh.readlines():
>         splitted = line.strip().split('\t')
>         data.append(splitted[0])
>         data1.append(splitted[1])
>         for k in data:
>                 if k in data1:
>                         result.append(k)
>                         print result
> fh.close()
>
> can you tell me problem with my script and what should is do for this

No, I have not tested it. You tell us the problem, and we might understand the 
situation better than you.

-- 
      Regards,                       Thomas Jollans
GPG key: 0xF421434B may be found on various keyservers, eg pgp.mit.edu
Hacker key <http://hackerkey.com/>:
v4sw6+8Yhw4/5ln3pr5Ock2ma2u7Lw2Nl7Di2e2t3/4TMb6HOPTen5/6g5OPa1XsMr9p-7/-6



More information about the Python-list mailing list