[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Omaha.pm] Processing a CSV file.
Jay, my CentOS 6.4 box only has perl 5.10.1 but your code still
worked. Might there be cases where it would not and 5.18.0 is
required?
On Tue, Oct 29, 2013 at 1:03 AM, Howard Parks <gottobtru@gmail.com> wrote:
> See also Text::CSV::Slurp - assumes first line is header, creates hashref.
>
> On Mon, Oct 28, 2013 at 7:13 PM, Jay Hannah <jay@jays.net> wrote:
>> On Oct 28, 2013, at 2:39 PM, Dan Linder <dan@linder.org> wrote:
>>> Is there a cleaner way of getting the @headers2 and @values2 array and then walking through both of them in the for loop?
>>
>> hmmm... this is one of those cases where I'd probably stick with a C-style for loop. :)
>>
>>> I thought I could set the header once (using column_names() ?) and then pull in the values line and do a foreach on the headers, but I couldn't get that to work.
>>>
>>> Thoughts or examples?
>>
>> Does this help?
>>
>> https://github.com/jhannah/sandbox/blob/master/danlinder/go.pl
>>
>> Cheers,
>>
>> j
>>
>>
>>
>>
>> _______________________________________________
>> Omaha-pm mailing list
>> Omaha-pm@pm.org
>> http://mail.pm.org/mailman/listinfo/omaha-pm
> _______________________________________________
> Omaha-pm mailing list
> Omaha-pm@pm.org
> http://mail.pm.org/mailman/listinfo/omaha-pm