On Mar 14, 8:25 pm, [EMAIL PROTECTED] wrote:
> Hi friends !!
>
> I'm neophite about python, my target is to create a programa that
> find a specific string in text file.
> How can do it?
>
> Thanks
> fel
I'd recommend regular expression (import re) if the string you're
searching is in a complex f
An of course, you can use a regular expression. (Module "re").
--
http://mail.python.org/mailman/listinfo/python-list
On 14 mar, 14:25, [EMAIL PROTECTED] wrote:
>> Hi friends !!
>>
>> I'm neophite about python, my target is to create a programa that
>> find a specific string in text file.
>> How can do it?
>>
>> Thanks
>> fel
>>
>
>
>
One more way to do this
f = codecs.open("log.txt", 'r', "utf_16_le")
2008/3/14, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
> Hi friends !!
>
> I'm neophite about python, my target is to create a programa that
> find a specific string in text file.
> How can do it?
>
> Thanks
> fel
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
If your only goal is to
> I'm neophite about python, my target is to create a programa that
> find a specific string in text file.
> How can do it?
>>> FNAME1 = 'has.txt'
>>> FNAME2 = 'doesnt_have.txt'
>>> TEXT = 'thing to search for'
>>> TEXT in file(FNAME1).read()
True
>>> TEXT in file(FNAME2).read()
False
or th
On 14 mar, 14:25, [EMAIL PROTECTED] wrote:
> Hi friends !!
>
> I'm neophite about python, my target is to create a programa that
> find a specific string in text file.
> How can do it?
>
> Thanks
> fel
$ cat text.txt
aaa
bbb
ccc
ddd
aaa bbb
ccc ddd
aaa bbb ccc ddd
aaa eee
bbb eee
ccc eee
ddd eee