-1
I made a script that reads the lines of a file, but now I need to ignore the first 3 lines and the last, returning only what is in the middle.
Below is a text file and script template.
text.txt:
H000000000000000000dsadsadsadsa0sad0sa0da0sd0sad0asd0asd0sa0s
H000000000000000000dsadsadsadsa0sad0sa0da0sd0sad0asd0asd0sa0s
H000000000000000000dsadsadsadsa0sad0sa0da0sd0sad0asd0asd0sa0s
FFFFFFFFF TESTE12 N TESTE12
FFFFFFFFF TESTE13 N TESTE13
FFFFFFFFF TESTE14 N TESTE14
FFFFFFFFF TESTE15 N TESTE15
T9999999999999999999esksddjsadsdk
script.:
# ! /usr /bin /perl
use strict;
use warnings;
my $filename = 'data.txt';
open(my $fh, '<:encoding(UTF-8)', $filename);
while (my $row = <$fh>) {
chomp $row;
print "$row\n";
}
print "Final\n";
If anyone can give a direction, thank you because I’m looking at some materials on the internet but still I’m having difficulties...