in reply to join column 3 for unique values
#!/usr/bin/perl # http://perlmonks.org/?node_id=1171182 use strict; use warnings; $_ = join '', <DATA>; 1 while s/^(\S+ \S+ ).*\K\n((?:.*\n)*)\1(.*\n)/:$3$2/m; print; __DATA__ A1 abc yellow B1 xyz green A2 cde red A1 abc green A2 cde yellow A1 abc blue
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: join column 3 for unique values
by hello_beginner (Novice) on Sep 05, 2016 at 14:03 UTC | |
by Anonymous Monk on Sep 05, 2016 at 21:48 UTC |