使用perl在excel中只编写一次头文件内容??? [英] writing the header content only once in excel using perl ???

查看:63
本文介绍了使用perl在excel中只编写一次头文件内容???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

主持人:

对不起,我已经把这个问题发布给会员,而不是放在论坛上。

致全部:


问题:


我正在读取excel文件中的数据&安培;将其内容写入另一个excel file.problem是每次读取数据时都会写入所有内容。

i希望脚本只写一次头文件。


输出如下所示:

Hi All,

To Moderator :
Sorry i have posted this querry to member rather putting in the forum.

To All:

Problem stmt:

I am reading the data from the excel files & writing its content to another excel file.problem is that everytime it reads data it writes all the content.
i want the script to write the header only once.

output look like this:

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号

推荐答案

试试这个,此代码未经测试。


但这应该是你想要的...



替换:

try this, this code is untested.

but this should be what you want...


Replace:

展开 | 选择 | Wrap | 行号


感谢Icecrack尝试...


i已经按照你所说的但仍然得到了相同的结果,即输出文件中的多个标题。


我们可以这样做,每次脚本写入内容检查输出文件中的第一行内容。如果它存在,则跳过行,否则将数据附加到excel文件中。

我们可以这样做吗???如此在剧本中如何做到这一点???


问候,

vijayarl
Thanks Icecrack for giving a try...

i have followed what u said but still am getting the same result ie, multiple headers in output file.

hey can we do like this, everytime script writes the content check for the first line content in the output file.if it exists then skip the line else append the data in the excel file.
can we do this approach ??? fi so how to do that in the script ???

Regards,
vijayarl



感谢Icecrack尝试...


我们可以这样做,每次脚本都会在输出中写入第一行内容的内容检查file.if它存在然后跳过行,否则将数据附加到excel文件中。

我们可以这样做吗???如此在剧本中如何做到这一点???


问候,

vijayarl
Thanks Icecrack for giving a try...

hey can we do like this, everytime script writes the content check for the first line content in the output file.if it exists then skip the line else append the data in the excel file.
can we do this approach ??? fi so how to do that in the script ???

Regards,
vijayarl



我们可以做到这一点。为此,请替换脚本的以下部分:

We can do that. For this, replace the following portion of script:

展开 | 选择 | Wrap | 行号


这篇关于使用perl在excel中只编写一次头文件内容???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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