On Monday 31 December 2007 10:36, Chris Fuller wrote:
> lin = re.findall('\s*([^\s]+)\s+([^\s]+)\s+(\d+)( [kM])?bytes', s)
This is incorrect. The first version of the script I wrote split the file
into records by calling split('bytes'). I erroneously assumed I would obtain
the desired results
Chris Fuller wrote:
> This is a classic case for the use of regular expressions. A powerful tool,
> but can be tricky. I create a RE for a record, and than use the findall()
> function to get all of them in a list. I'll walk you through it.
> # seperate into records
> lin = re.findall('\s*([
On Monday 31 December 2007 06:19, goldgod a wrote:
> hello all,
> Please find the attached file. I want to sort the content
> of this file based on the "bytes" in descending order. How can i do
> it, any pointers to it.
This is a classic case for the use of regular expressions. A powe
goldgod a wrote:
> hello all,
> Please find the attached file. I want to sort the content
> of this file based on the "bytes" in descending order. How can i do
> it, any pointers to it.
There are several things to do here:
- read the file
- split into records
- extract the byte count
-
hello all,
Please find the attached file. I want to sort the content
of this file based on the "bytes" in descending order. How can i do
it, any pointers to it.
--
Thanks & Regards,
goldgod
test
Description: Binary data
___
Tutor maillist