Khalid Moulfi wrote:
>
> Actually, I'm a little bit blocked.
>
> I have, let's say, thousands of file (NIST file). In the first line of
> all of them I have tag numbers plus many informations, even sometimes
> strange chararcters (Maybe Hexadecimal).
> A line can look like :
>
> 1.001:nnnn<Special character>1.002:xxxx<Special
> character>...2.083:Strange character<Special character>2.087:Strange
> character
>
> First, when I read the 1st line of each of these files and do a
> len(line), I do not have the same number of chararcters between the
> return of len(line) and the number returned by the editor Scite (It
> gives the number of column).
Your description is too sketchy to come with a real analysis, but if
you're reading a file that contains more than just simple text
characters, you probably need to open the file in binary mode:
f = open( 'xxxx.bin', 'rb' )
You probably need to examine this file with a hex editor to figure out
what it really contains.
If you want, you could send me one of the files, and a detailed
description of what you want out of them. Perhaps we can come with a
data structure that's easier to work with.
--
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32