Packages

File parser for popular excel formats: xls (Excel 2003), csv, xlsx (Excel 2007). Stores data in ets (except for csv, which uses stream).

Current section

Files

Jump to
suexcxine_exoffice lib exoffice parser excel_2003 cell.ex
Raw

lib/exoffice/parser/excel_2003/cell.ex

defmodule Exoffice.Parser.Excel2003.Cell do
def string_from_column_index(p_column_index \\ 0) do
# Determine column string
cond do
p_column_index < 26 ->
<<65 + p_column_index>>
p_column_index < 702 ->
<<64 + round(Float.floor(p_column_index / 26))>> <> <<65 + rem(p_column_index, 26)>>
true ->
<<64 + round(Float.floor((p_column_index - 26) / 676))>> <>
<<65 + round(Float.floor(rem(p_column_index - 26, 676) / 26))>> <> <<65 + rem(p_column_index, 26)>>
end
end
end