将每个 Excel 列导出到单独的文本或 csv 文件?
我有一个包含大约 100 列的 Excel 工作表。有谁知道将每列的内容写入 csv 或 txt 文件的简单方法?
I have an Excel worksheet with around 100 cols. Does anyone know of an easy way to write the contents of each column to a csv or txt file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我面前没有 Excel,但我认为这段代码大约是您所需要的,可能会出现一些语法错误。它应该将每一列写入一个单独的文件中,每个单元格位于不同的行上。尽管列数是一个变量(目前),但它适用于任意列高。
让我知道这是否有帮助,如果您愿意,我可以稍后再看一下
I don't have Excel in front of me, but I think this code is approximately what you need, give or take some syntax errors. It should write each column into a separate file, with each cell on a different row. It will work for arbitrary column heights, though the number of columns is in a variable (for now).
Let me know if that helps or not, I can take another look later if you would like
也许
Perhaps
一条非常快速的线路可以帮助您开始......
A very quick line to get you started ...