in reply to Re^2: database sorter script
in thread database sorter script
Assuming it is relatively small and unsorted by default:
#!/usr/bin/perl -w my $db = '/some/file'; my $letter = 'Y'; open DB, $db or die "Can't read $db: $!\n"; my @matches; while(<DB>){ push @matches, $_ if m/^$letter/i; } close DB; print sort @matches;
Or more succinctly on *nix:
$ grep -i -e ^Y db.file | sort
cheers
tachyon
In Section
Seekers of Perl Wisdom