prints:use warnings; use strict; while (<DATA>) { if (/Name\s+LUN\s+(\d+)/){ my $lunid = $1; print "\n!$lunid!\n"; print $_; exit; } } __DATA__ Total Hard Errors: 0 Total Soft Errors: 0 Total Queue Length: 0 Name LUN 259 Minimum latency reads N/A
Aside: you only need to use code tags for your code and data, not for your question: Writeup Formatting Tips!259! Name LUN 259
In reply to Re: Parse a File and get a value
by toolic
in thread Parse a File and get a value
by xossa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |