in reply to Multiple line records from a command string
How's this?
#! perl -slw use strict; $/ = "\nS"; m[ Device \s Symmetrix \s Name \s+ : \s+ ( [^\n]+ ) .+? Device \s Serial \s ID \s+ : \s+ ( \d+ ) .+? KiloBytes \s+ : \s+ ( \d+ ) .+? SCSI-3 \s Persistent \s Reserve : \s+ ( \S+ ) .+? ]smx and print "name:$1\nID:$2\ncap:$3\nRes:$4" while <DATA>; __DATA__ ******** Two copies of the supplied example ************
Output:
c:\test>junk75 name:0062 (VCM) ID:6000062081 cap:5760 Res:Disabled name:0062 (VCM) ID:6000062081 cap:5760 Res:Disabled
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Multiple line records from a command string
by molecules (Monk) on Feb 23, 2010 at 17:33 UTC | |
|
Re^2: Multiple line records from a command string
by spq (Friar) on Feb 23, 2010 at 15:40 UTC | |
by BrowserUk (Patriarch) on Feb 23, 2010 at 16:02 UTC | |
|
Re^2: Multiple line records from a command string
by shmem (Chancellor) on Feb 23, 2010 at 18:18 UTC | |
by Anonymous Monk on Feb 23, 2010 at 20:10 UTC | |
|
Re^2: Multiple line records from a command string
by Preceptor (Deacon) on Feb 24, 2010 at 08:39 UTC |