in reply to need help in extracting lines
Others have already addressed your explicit question, but I'd like to suggest a different approach to your problem. Of couse, I'm making some assumptions about the real nature of your problem, so correct me if I'm wrong. Or simply disregard. :-)
It appears that your data is a series of chunks separated by empty lines, and that each chunk begins with a Table: ... line. If so, then we could use perl's "paragraph" mode of reading input records:
local $/ = ''; # read paragraphs while (<>) { # each paragraph is multiple lines, the first of which is "Table: .. +." # and the second is some kind of tag enclosed in brackets. my( $table ) = /^Table: (.*)/ or die "Hm... bad paragraph:\n$_"; my( undef, $tag, @lines ) = split /\n/; if ( $tag eq '[Alias]' ) { push @aliases, \@lines; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: need help in extracting lines
by Wiggins (Hermit) on Jan 13, 2009 at 20:46 UTC | |
by jdporter (Paladin) on Jan 13, 2009 at 21:25 UTC |