in reply to select elements in a list
Here is the output, assuming "foo.txt" is your start file:#!/usr/bin/env perl use warnings; use strict; open my $fh, '<', 'foo.txt' or die "Can not open file: foo.txt: $!\n"; while (<$fh>) { if (/^\w{3};\w/) { print; # or do whatever you need to do... } } close $fh or die "Can not close file: foo.txt: $!\n";
TEC;UTF;TDE;450 TEC;URT;TDE;687 TEC;UGC;TDE;687
|
|---|