script to shorten usernames and output to file

Hopefully someone here can point me in the correct direction.
I'm working on a username migration and am trying to map my users ols usernames to the new ones.

Right now every user has a username of firstname.lastname i.e. john.doe

I'm trying to create a bash or python script that will take a text file with all the users and only output a list of usernames in the following format i.e. jdoe

Can it be Perl?

perl -nle '/^(.).*\.(.*)/;print "$1$2"' username-list
1 Like

See if this works for you:

sed 's/^\(.\).*\(\..*\)/\1\2/' Input_File

Thanks, that did the trick. Saved me a few hours of work doing it manually.