in reply to how to parse to get only the replica names in an array
You can try something like:
use strict; use warnings; my @replicas; while (<DATA>){ next if (! /^\d+/); /replica\s+"(.+)"/; push @replicas,$1; } __DATA__ 2005-04-01 root replica "ml_v_dialer" 2004-06-22 root replica "pu_v_dialer" 2006-02-11 ccvob01 replica "rd_v_dialer" "v_dialer replica for Redmond" 2003-11-25 root replica "v_dialer_drcalvin"
Update: Another possibility (if the file to process is not too big):
use strict; use warnings; { local $/; my @replica = <DATA> =~ /replica\s+"(.+)"/g; }
citromatik
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to parse to get only the replica names in an array
by naikonta (Curate) on Aug 08, 2007 at 10:31 UTC | |
by citromatik (Curate) on Aug 08, 2007 at 10:42 UTC | |
by naikonta (Curate) on Aug 08, 2007 at 16:32 UTC |