在CSV文件中创建多个工作表 [英] Creating multiple sheets in CSV file

查看:630
本文介绍了在CSV文件中创建多个工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用superCSV以csv格式在我的代码中写入数据。它的工作绝对精细和非常有效,但现在我的要求改变。我需要在单个xls文件中写多个工作表,这是非常耗时的任务。所以在supercsv中有任何方式,我可以在单个csv文件中写多个工作表数据,并将其发送到客户端,以便当客户端在MS-Excel中打开此csv文件时,他可以看到多个工作表,而不是我生成

I am using superCSV to write data in csv format in my code. Its working absolutely fine and very efficiently , but now my requirement changed . I need to write multiple sheets in single xls file which is very time consuming task. So is there is any way in supercsv by which i can write multiple sheet data in single csv file and will send it to client, so that when client open this csv file in MS-Excel, he can see multiple sheets rather than me generating the excel file with with multiple sheets and sending it to client.

感谢

推荐答案

CSV是一种非常简单的格式,并且没有工作表的概念。
所以,不,不可能直接。
我唯一可以建议的是发送多个csv文件到客户端,可能是一个.zip文件,并让客户端unizp它,并一次导入一个表格到Excel。

CSV is a very simple format, and does not have the concept of a "sheet". So, no, it's not possible directly. The only thing that I can suggest is to send multiple csv files to the client, perhaps as a .zip file, and have the client unizp it and import one sheet at a time into Excel.

如果您需要在浏览器中直接打开,您需要使用xls文件。

If you need it to open directly in the browser, you'll need to go with an xls file.

这篇关于在CSV文件中创建多个工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆