in reply to No tools? Use Perl?!
Your while loop looks at one line at a time but your text says "synopsis (multi line)" ... D'oh!
Even if you are disconnected from the net you must have some modules installed, maybe you can have a look around and see if someone else got a useful module installed.
If not, let's hope the files are small enough to fit in memory
# Suck in the whole file my $text = do { local $/; <$fh> }; # use a nested group to exclude the close tag while ($text=~ m{<ReportHost[^>]*>(?:(?!</ReportHost>).)*</ReportHost> +}s) { # print out the content of each ReportHost tag print "$1\n"; }
Untested! :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: No tools? Use Perl?!
by haukex (Archbishop) on Jul 28, 2016 at 11:48 UTC | |
by Boyd.Ako (Novice) on Jul 29, 2016 at 02:00 UTC | |
by haukex (Archbishop) on Jul 29, 2016 at 07:14 UTC | |
|
Re^2: No tools? Use Perl?!
by Anonymous Monk on Jul 28, 2016 at 11:40 UTC | |
|
Re^2: No tools? Use Perl?!
by Boyd.Ako (Novice) on Jul 29, 2016 at 01:58 UTC |