in reply to grabbing chunks of text
Assuming you can get the lines into an array, grep is your friend:
use strict; use warnings; use Data::Dumper qw/Dumper/; my @lines = (<DATA>); @lines = grep {/type\s=/} @lines; print Dumper \@lines; __DATA__ amis150hx/logic/scl/amis150hxapra/current/amis150hxapra_bc_1.65v_m40c. +scl 35: -100mA < i_max < 100mA, amis150hx/logic/scl/amis150hxapra/current/amis150hxapra_bc_1.65v_m40c. +scl 36: -1.10v < vdiode_vss < -0.20v, amis150hx/logic/scl/amis150hxapra/current/amis150hxapra_bc_1.65v_m40c. +scl 31: type = digital_bidir, amis150hx/logic/scl/amis150hxapra/current/amis150hxapra_bc_1.65v_m40c. +scl 38: 0.2v < vd < 1.2v, amis150hx/logic/scl/amis150hxapra/current/amis150hxapra_bc_1.65v_m40c. +scl 42: iol = 16mA, amis150hx/logic/scl/amis150hxapra/current/amis150hxapra_bc_1.65v_m40c. +scl 43: ioh = -16mA; amis150hx/logic/scl/amis150hxapra/current/amis150hxapra_bc_1.65v_m40c. +scl 45:IOFCXVCVCXVE12S amis150hx/logic/scl/amis150hxapra/current/amis150hxapra_bc_1.65v_m40c. +scl 46: type = digital_bidir,
Gives:
Alternately, you can process your file line by line, capturing only lines that match the simple regex I used in the grep block. HTH.$VAR1 = [ 'amis150hx/logic/scl/amis150hxapra/current/amis150hxapra_bc_ +1.65v_m40c.scl 31: type = digital_bidir, ', 'amis150hx/logic/scl/amis150hxapra/current/amis150hxapra_bc_ +1.65v_m40c.scl 46: type = digital_bidir, ' ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |