如何输出excel到textfile? [英] how to output excel to textfile?

查看:114
本文介绍了如何输出excel到textfile?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有以下代码从Excel工作表中提取单元格值

但是我知道如何继续将其输出到文本文件?

我不太清楚怎么做,谢谢

hi guys,
i''ve got the code below that extract cell value from an excel sheet
but any idea how i continue to output it to a text file?
i''m not too sure how to do it, thanks

展开 | 选择 | 换行 | 行号

推荐答案

它返回了二维数组,即一个引用数组的数组。


所以从数组引用得到的值
It has returned two dimensional array i.e an array with references to arrays.

so the value to be get from the array reference
展开 | 选择 | Wrap | 行号


hm..i think代码有问题

u可以将它传递给数组并打印出值,

但它不打印到文本文件
有关如何将值打印到文本文件的任何建议吗?
hm..i think there''s a problem with the code
u can pass it into an array and print out the values,
but it''s not printing to a text file
any suggestion how i can print the values to a text file?



hm..i认为这里有一个代码问题

u可以将它传递给数组并打印出值,

但是它不打印到文本文件

任何建议如何将值打印到文本文件?
hm..i think there''s a problem with the code
u can pass it into an array and print out the values,
but it''s not printing to a text file
any suggestion how i can print the values to a text file?



如果要输出到文件,则必须首先打开文件并分配文件句柄,然后使用文件句柄指向print语句到文件输出。


这是一个例子:

If you want to output to a file, then you have to first open a file and get a file handle assigned, then use the file handle to point the print statement to the file for output.

Here is an example:

展开 | 选择 | Wrap | 行号


这篇关于如何输出excel到textfile?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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