Hello pruebauno,

> import re
> f=file('tlst')
> tlst=f.read().split('\n')
> f.close()
tlst = open("tlst").readlines()

> f=file('plst')
> sep=re.compile('Identifier "(.*?)"')
> plst=[]
> for elem in f.read().split('Identifier'):
>       content='Identifier'+elem
>       match=sep.search(content)
>       if match:
>               plst.append((match.group(1),content))
> f.close()
Look at re.findall, I think it'll be easier.

> flst=[]
> for table in tlst:
>       for prog,content in plst:
>               if content.find(table)>0:
        if table in content:
>                       flst.append('"%s","%s"'%(prog,table))

> flst.sort()
> for elem in flst:
>       print elem
print "\n".join(sorted(flst))

HTH.
--
------------------------------------------------------------------------
Miki Tebeka <[EMAIL PROTECTED]>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys

Attachment: pgp9Fde43cw8j.pgp
Description: PGP signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to