Tag: erlang

通过Erlang编写Excel文件

我正在尝试通过erlang编写excel文件。 我用下面的代码来编写excel文件 -module(excel). -export([start/1]). start(Val)-> case file:open("office-test.xls",[append]) of {ok,Fd} -> io:format(" file created"), io:fwrite(Fd,"~p\t~p\t~p~n", ["Name","Date","Number"]), export(Fd,Val), file:close(Fd); {error,_} -> io:format("~nerror in creation of file") end. export(_,0)-> ok; export(Fd,Val) -> io:fwrite(Fd, "~p\t~p\t~p\t~n" ,["B123","2012/10/11 12:12:12","val"++integer_to_list(Val)]), export(Fd,Val-1). 它能够写成功,但是当我在LibreOffice打开。 我popup了一个popup窗口询问数据分开。 我不希望最终用户在其上工作。 1)有什么办法可以让办公室(ms office或libre office)自动parsing它。 2)是否有任何其他方式通过erlang写入excel表单?