I tried PetitParser for the first time a few days ago, to import some data required for testing my Masters project (which is due RealSoonNow(c)).  I found it easy to adapt PetitCSV for part of my requirement, but am having trouble extending it further.  I was hoping to get a lot done this vacation on completing my project but this is slowing me down.

Now since everyone has better things to do this festive break, I am offering two small bounties of AUD $50 to hopefully draw the attention of someone more familiar with PetitParser, for whom this will hopefully be much quicker than my random experimenting. 

The attached LEImportSKMPowerToolsData.txt shows a sample of what I need to parse.  A single file containing multiple tables (12 of) with the data of each table in CSV format.  Tables start with a line "// --- tablename ---", followed by column names on the next line, followed by multiple lines of data.

Using the attached LEImportSKMPowerTools.st (also see attached LEImportSKMPowerTools.txt formatted for quick reference )
I can successfully parse the first table of the following sample...
=========
// --- Bus ---
//<ComponentName>,<ComponentType>,<SystemNominalVoltage>,<AF_ArcType>,<AF_WorkingDistance>
00BFA10,10,415,In Box,609.6
00BFA20,10,415,In Box,609.6

// --- Cable ---
//<ComponentName>,<SystemNominalVoltage>,<Phase>,<CableSize>,<NeutralSize>,<Length>,<Size/Do Not Size>
11P08023,11500,ABC,240,,680.0,Do Not Size
11P08024,11500,ABC,240,,610.0,Do Not Size
=========
... but the next table ends up as a subpart of the first as shown in the following result for the above sample...
#(
    #('Bus'
        #('ComponentName' 'ComponentType' 'SystemNominalVoltage' 'AF_ArcType' 'AF_WorkingDistance')
        #(
            #('00BFA10' '10' '415' 'In Box' '609.6')
            #('00BFA20' '10' '415' 'In Box' '609.6')
            #('')
            #('// --- Cable ---')
            #('//<ComponentName>' '<SystemNominalVoltage>' '<Phase>' '<CableSize>' '<NeutralSize>' '<Length>' '<Size/Do Not Size>')
            #('11P08023' '11500' 'ABC' '240' '' '680.0' 'Do Not Size')
            #('11P08024' '11500' 'ABC' '240' '' '610.0' 'Do Not Size')
        )
    )
)

Essentially I don't know how to close off the pattern matching at the blank line following the data rows, so that the next table can be started.   Also something I hadn't looked at yet,  LEIMportSKMPowerToolsData.txt  has comment lines starting with '//' that need to be ignored along with the blank lines.

So two things are required for the first $50.
1. The above result needs to instead have two close-round-brackets in place of the blank line  #('')  so that  #('Cable'  appears at the same level as  #('Bus'
2. The comments and blank lines need to be ignored.

In addition, all of the PetitParser documentation that I find says "parse a string (or stream)" but I see no actual samples of using a stream.  Changing from using a string to a stream is pretty basic I should probably be able to guess, but while I have your attention I may as well learn what is best practice. 

------------
I also offer a second AUD $50 for the following...
1. A method to which I pass a filename, that will return an object which can be accessed with the tablename to return a collection of rows,
2. A cell in one of those rows can be accessed by the column name.

This will just be a temporary step to move the data into my own internal format, so it doesn't need to be elegant.  I had two rough
separate ideas:
a. A simple dictionary of array of dictionaries.
b. A method that when passed a column name will return the array index into a row.

------------
So I hope that it worth someone's while to attend to this quickly.  Technical discussion should continue here.   I am not quite sure yet how I'll handle multiple solutions.  The method of payment will need to be discussed privately with contributors once requirements are met.

hope you are all enjoying your festive season...
cheers -ben