in reply to Creating a text index for a text file

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