Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Please help...

by mifflin (Curate)
on Mar 10, 2011 at 21:38 UTC ( #892541=note: print w/replies, xml ) Need Help??


in reply to Please help...

[tauser02@gfmwsp02lds bin]$ cat x use strict; use warnings; my %data; while (<DATA>) { my ($cluster, $unit) = split /\s+/; push(@{$data{$cluster}}, $unit); } for my $cluster (sort keys %data) { print $cluster, ' ', join(' ', @{$data{$cluster}}), "\n"; } __DATA__ Cluster1 unit1 Cluster1 unit2 Cluster1 unit3 Cluster1 unit4 Cluster1 unit5 Cluster2 unit6 Cluster2 unit7 Cluster2 unit8 Cluster2 unit9 Cluster2 unit10 [tauser02@gfmwsp02lds bin]$ perl x Cluster1 unit1 unit2 unit3 unit4 unit5 Cluster2 unit6 unit7 unit8 unit9 unit10

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://892541]
help
Chatterbox?
[ELISHEVA]: plus it bugs me that something that *should* be simple, *should* work- unicode and noms aren't exactly the new kids on the block
[ELISHEVA]: well then since the obvious possible mistakes on my part have been ruled out, SOPW it is.
[ELISHEVA]: the data source, or one of them, is the OECD - they provide a *lot* of data that ought to be easily available to perl programmers.
[erix]: it might be cunning to mention the module in the title... :)
[ELISHEVA]: fancy that - a title that actually describes the problem :-)
[ELISHEVA]: but actually thanks for the reminder
[Discipulus]: DBI::CSV + utf8 = BOO?M
[erix]: in extremis we tend to forget stuff ;)
[ELISHEVA]: \Disciplus : lol
[Discipulus]: and ELISHEVA we waait one your post since ~2years... ;=)

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2017-05-28 20:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?