> From: Tomas Markus <[EMAIL PROTECTED]>
> Just to let you know my ressults (+ one tiny question :-):
> I did a bit of investigation and narrowed the "invalid" characters group to
> jus one the hex 1a. My code now looks quite small:
>
> fpath = 'c:\\pytemp\\bafir550.edi'
> fl = file(fpath, 'rb')
>
[Keeping tutor in CC]
-- Forwarded message --
Date: Thu, 20 Oct 2005 23:21:13 +0200
From: Tomas Markus <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] file.read. Abort Problem
Hi All,
Just to let you know my ressults (+ one tiny questio
> I was going to ask why you think regex is a sledgehammer for this one,
Regex's are more complex because we have to then make sure that none of
the testchars have any special meaning as regular expression
metacharacters. If one of those test chars, for example, contained things
like '-' or '\\',
Kent Johnson wrote:
> Here is a program that scans a string for test chars, either using a single
> regex search or by individually searching for the test chars. The test data
> set doesn't include any of the test chars so it is a worst case (neither scan
> terminates early):
>
> # FindAny.py
>
Danny Yoo wrote:
>
> On Thu, 20 Oct 2005, Tomas Markus wrote:
>>what is the most effective way to check a file for not allowed
>>characters or how to check it for allowed only characters (which might
>>be i.e. ASCII only).
>
>
> If the file is small enough to fit into memory, you might use regul
On Thu, 20 Oct 2005, Tomas Markus wrote:
> I am trying to read a file with some 2500 lines and to do a scan for "not
> allowed" characters in there (such as accented ones and so on). The problem
> is that the file I am testing with has got one of those somewhere on line
> 2100 (the hex value of
Tomas Markus wrote:
> Hello Pythoners,
>
> This is probably a very newbie question (after all I am one):
>
> I am trying to read a file with some 2500 lines and to do a scan for
> "not allowed" characters in there (such as accented ones and so on). The
> problem is that the file I am testing wi
Hello Pythoners,
This is probably a very newbie question (after all I am one):
I am trying to read a file with some 2500 lines and to do a scan for
"not allowed" characters in there (such as accented ones and so on).
The problem is that the file I am testing with has got one of those
somewhere o