If your file is not too big to fit in memory, then
perl -ne 'push@{$ndx{uc substr($_,0,1)}},$_;END{for(sort keys%ndx){pri +nt":$_:\n",@{$ndx{$_}}}}' sorted.txt
In reply to Re: Find
by Anonymous Monk
in thread Creating a text index for a text file
by texuser74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |