Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
My first go at dealing with delimited data has not been as straightforward as I expected :(
After stuffing around with various Text/CSV modules and super searching all over the place for an hour or two, I finally gave up and decided to write my own parsing routine. The data is tab delimited, with the first line being a header. Each column represents user attributes, and each row represents the data for a particular user. The only inconsistency in the data (if it is that), is that the header row has a leading hash (#), whereas the rest of the data doesn't. All I wanted to do is build a hash from the data, in the form $data->{$user}{$attribute} Although the code I have works, and is only about a dozen lines, I'm disappointed - because: a) I'm sure this could be done easier with the appropriate module - but I'm damned if I could work out how, and b) I've used both a flag and a counter, which I'm sure are redundant - but I don't know how to get rid of them Any advice? Thanks in advance --Darren
In reply to Parsing CSV into a hash by McDarren
|
|