That depends a whole lot on what you want to do with the data, how much data there is, how often it changes, where its coming from ...
If there is a small (for some definition of small) quantity of data that you want to process in some fashion indexed by location then something like this is likely what you are after:
use strict; use warnings; my %data; while (<DATA>) { my ($id, $location, $info) = /^((?:[^,]*,){2})([^,]*),(.*)$/; push @{$data{$location}}, "$id$info"; #Array of user entries for eac +h location } for (sort keys %data) { print "Location $_:\n "; print join "\n ", @{$data{$_}}; print "\n"; } __DATA__ Login,Name1,Location1,Info,Info2,Infoblah Login,Name2,Location1,Info,Info2,Infoblah Login,Name3,Location2,Info,Info2,Infoblah Login,Name4,Location2,Info,Info2,Infoblah
Prints:
Location Location1: Login,Name1,Info,Info2,Infoblah Login,Name2,Info,Info2,Infoblah Location Location2: Login,Name3,Info,Info2,Infoblah Login,Name4,Info,Info2,Infoblah
In reply to Re: Categorization Problem
by GrandFather
in thread Categorization Problem
by kayak9630
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |