tags:

views:

69

answers:

2

Possible Duplicate:
How to convert a column number (eg. 127) into an excel column (eg. AA)

How convert number to base26 column string for excel. lang perl

+4  A: 

Number::Latin

daxim
A: 

If it's something quick and dirty, the following sub may be useful.

sub column2base26 {

    my $column = shift;
    die "Column $column must be positive" unless $column > 0;

    my $string = 'A';
    $string++ for 2..$column;
    return $string;
}

print column2base26($_), "\n" foreach (23, 15, 333);

# Output:
# W
# O
# LU
Zaid
This is enough, thank you
jushlwest