Re: Parsing problems: A journey from a text file to a directory tree

2007-09-19 Thread Michael J. Fromberger
Hi, John, Your comments below are all reasonable. However, I would like to point out that the purpose of my example was to provide a demonstration of an algorithm, not an industrial-grade solution to every aspect of the original poster's problem. I am confident the original poster can deal w

Re: Parsing problems: A journey from a text file to a directory tree

2007-09-18 Thread John Machin
On Sep 19, 4:51 am, "Michael J. Fromberger" <[EMAIL PROTECTED]> wrote: > . > .# This expression matches "header" lines, defining a new section. > .new_re = re.compile(r'\[([\w ]+)\]\s*$') Directory names can contain more different characters than those which match [\w ] ... and which ones

Re: Parsing problems: A journey from a text file to a directory tree

2007-09-18 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, "Martin M." <[EMAIL PROTECTED]> wrote: > Hi everybody, > > Some of my colleagues want me to write a script for easy folder and > subfolder creation on the Mac. > > The script is supposed to scan a text file containing directory trees > in the following format: >

Re: Parsing problems: A journey from a text file to a directory tree

2007-09-17 Thread Larry Bates
Since you are going to need to do a dialog, I would use wxWindows tree control. It already knows how to do what you describe. Then you can just walk all the branches and create the folders. -Larry Martin M. wrote: > Hi everybody, > > Some of my colleagues want me to write a script for easy fol

Re: Parsing problems: A journey from a text file to a directory tree

2007-09-16 Thread Neil Cerutti
On 2007-09-16, Martin M. <[EMAIL PROTECTED]> wrote: > Hi everybody, > > Some of my colleagues want me to write a script for easy folder and > subfolder creation on the Mac. > > The script is supposed to scan a text file containing directory trees > in the following format: > > [New client] >|-Invoi

Parsing problems: A journey from a text file to a directory tree

2007-09-16 Thread Martin M.
Hi everybody, Some of my colleagues want me to write a script for easy folder and subfolder creation on the Mac. The script is supposed to scan a text file containing directory trees in the following format: [New client] |-Invoices |-Offers |--Denied |--Accepted |-Delivery notes As you can see,