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 reply to Re^3: database sorter script
by tachyon
in thread database sorter script
by santander
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |