Skip Menu |

This queue is for tickets about the Text-CSV-Simple CPAN distribution.

Report information
The Basics
Id: 61326
Status: open
Priority: 0/
Queue: Text-CSV-Simple

People
Owner: Nobody in particular
Requestors: sod20 [...] cam.ac.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Feature request: want_fields by name
Date: Tue, 14 Sep 2010 11:18:49 +0100
To: bug-Text-CSV-Simple [...] rt.cpan.org
From: Sam Duke <sod20 [...] cam.ac.uk>
I think it is fairly common to have a CSV file with the first line being a list of headings. I am using want_fields to select the appropriate columns, but it would be great to select the correct ones based on a name. Alternatively, if I could just tell the parser to parse the first line so that I can hunt for the index of the correct headings and then go ahead and do a full parse, that would be great. Or even just a 'before_loop' trigger before foreaching through the lines, just before this line: "foreach my $line (@lines) {" would make this possible... Otherwise, this is a great module! Sam ps. eg of the type of CSV file i mean: Name, Value, Result Box,3,pass Table,4,fail
Subject: Re: [rt.cpan.org #61326] Feature request: want_fields by name
Date: Tue, 14 Sep 2010 11:26:09 +0100
To: bug-Text-CSV-Simple [...] rt.cpan.org
From: Tony Bowden <tony [...] tmtm.com>
On Tue, Sep 14, 2010 at 11:19 AM, Sam Duke via RT <bug-Text-CSV-Simple@rt.cpan.org> wrote: Show quoted text
>  I think it is fairly common to have a CSV file with the first line > being a list of headings. I am using want_fields to select the > appropriate columns, but it would be great to select the correct ones > based on a name.
Agreed! Patches welcome... Tony
Subject: Re: [rt.cpan.org #61326] Feature request: want_fields by name
Date: Wed, 15 Sep 2010 09:11:21 +0100
To: bug-Text-CSV-Simple [...] rt.cpan.org
From: Sam Duke <sod20 [...] cam.ac.uk>
On 14/09/2010 11:26, tony@tmtm.com via RT wrote: Show quoted text
> Agreed! Patches welcome... > > Tony >
Alright, I'm busy for the moment, should be off this project in a couple of weeks. I suggest the user passing in a sub or regex to do the matching along with an array of strings. After they are found, add the index to want fields. Have some kind of optional switch that also fills field_map with the appropriate strings. Don't remove the first row returned in any case, firstly to be more consistent with the current behaviour and secondly because you might want to see what was found for your search string. Sound reasonable? Sam