I was recently asked in a job interview to resolve a programming puzzle that I thought it would be interesting to share. It\'s about translating Excel column letters to actu
Read a column name from STDIN and print out its corresponding number:
perl -le '$x = $x * 26 - 64 + ord for <> =~ /./g; print $x'
Caveats: Assumes ASCII.
EDIT: Replaced " with ' so that your shell won't interpolate $x in the string.
"
'
$x