Here's an alternative method involving grep and split:
local $/; my $data = <DATA>; my @found = grep /^[IO]/ => split /\n/ => $data; print map { join '' => $_, "\n", } @found; # or whatever. __DATA__ group: device_info In ; 10 ; 0x0 ; 0x100cd ; .1 Out ; 10 ; 0x0 ; 0x100d3 ; .1 In ; 20 ; 0x0 ; 0x500c4 ; .1 Out ; 20 ; 0x0 ; 0x500d4 ; .1 data: None
In reply to Re: File Parsing
by slife
in thread File Parsing
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |