I have the following list of items:
bigBone
fishMarket
dogCollar
...
I need to generate a two character mapping like this:
bigBone -> bb
fishMarket -> fm
dogCollar -> dc
...
How can I create the above mapping using sed
?
I have tried something like:
sed -i -r 's/^([a-z]{1})[a-z]+([A-Z]{1})[a-zA-Z]+/ -> \1\L\2/' file
I saw this question, but not sure how to incorporate the concept here. Thanks.