search between 2 files

José jmcalvar at telecable.es
Wed Feb 4 10:29:01 EST 2004


I think with the both solutions it works if I have the files in the same 
format, so I think I'll call a script command to have the files in the 
same way, and when I learn more python I'll try with regular expressions

:-))

thank you very much


José escribió:

> mmmh, it's not the same, but I try with this indications.
> 
> I have a file called "data" from djbdns with different domain, for example:
> 
> ----------------------
> .domain.com:ns.domain.com
> +domain.com
> +.*domain.com
> .domain1.com:ns.domain1.com
> +domain.com
> +.*domain.com
> ------------------------
> 
> and have a new file for example "list" with new domains
> 
> -------------------------
> newdomain.com
> newdomain1.com
> newdomain1.com
> -------------------------
> 
> I'm programming a little interface in python, and before I modify the 
> "data" file I'd like to know if I have in the list one domain I have in 
> data.
> 
> Thans
> 
> 
> 
> 
> José escribió:
> 
>> I'm newby in Python, and I'm working on a script to manage files.
>> I have two files, one with a list of domains, and the other with a new 
>> list of domains. I'd like to know if I have a repeated domain in the 
>> new's one. I tried opening with readline(), with readlines(), but 
>> truly I have no idea to countinue.
>>
>> Have anybody any question?
>>
>> thanks
>>
> 




More information about the Python-list mailing list