This is a case for a perl regular expression. It should look something like this,
qr is a quoting operator which lets you precompile a regex for later use.my $re = qr/^[A-Z][^_]*_[A-Z][^_]*_[a-z][^.]*\.html$/; open my $fh, '>', 'badnames.txt' or die $!; while (<DATA>) { print $fh $_ unless m/$re/; } close $fh or die $!; __DATA__ Kilo_Kili_asc.html kilo_Kili_asc.html Jiko_Huji_asc.html Jiko_Huji_asc.htm Puji_huki_asc.html Puji_Huki_Asc.html
After Compline,
Zaxo
In reply to Re: Perl Scripting for testing
by Zaxo
in thread Perl Scripting for testing
by fairul82
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |