亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標題: 求perl對excel 操作代碼 [打印本頁]

作者: 林間笑客    時間: 2015-05-04 20:50
標題: 求perl對excel 操作代碼
請問各位前輩,如何使用perl 操作excel ???
比如我想刪除file A 中的 第六列任意元素與中fileB 中第四列任意元素相同的fileA的 行
file A
                 第六列  
丁玉潔     18755323055
周江  18610019611
湯新景  18911258305
魯理平  13126719757
郭林青  15910552285
薄祥潔  13664401866
file B
                  第四列
王青華    13664401866
劉瑤瑤    12389581064
徐龍華    13531521634
胡高爽    13924154657
魏學玲    15641253478
韓中惠    14253856990
石磊       31433266458
趙濤       14136548679

其中A 的丁玉潔號碼與B 的王青華號碼重了, 我想講A 中的重的這個人的所有信息也就是這一行都刪除,該怎么實現(xiàn)呢?
作者: zhlong8    時間: 2015-05-05 09:49
Perl 有處理 excel 的模塊但是我不會用啊,上 metacpan.org 上面搜 excel 就能找到。這要是csv格式的話 Perl 做起來還是很簡單的
作者: 523066680    時間: 2015-05-22 11:39
樓上是故意的
作者: xkf01    時間: 2015-05-22 13:02
提示: 作者被禁止或刪除 內(nèi)容自動屏蔽
作者: alexru    時間: 2015-05-24 08:19
樓上是故意的
作者: yaohuabing    時間: 2015-06-06 08:05
本帖最后由 yaohuabing 于 2015-06-06 08:06 編輯

perl處理excel最常用的module是
Spreadsheet::WriteExcel (生成新的excel) 和
Spreadsheet::ParseExcel(讀excel)
在WriteExcel的文檔里關(guān)于修改已有的excel,有這么一段:

MODIFYING AND REWRITING EXCEL FILES

An Excel file is a binary file within a binary file. It contains several interlinked checksums and changing even one byte can cause it to become corrupted.

As such you cannot simply append or update an Excel file. The only way to achieve this is to read the entire file into memory, make the required changes or additions and then write the file out again.

You can read and rewrite an Excel file using the Spreadsheet::ParseExcel::SaveParser module which is a wrapper around Spreadsheet::ParseExcel and Spreadsheet::WriteExcel. It is part of the Spreadsheet::ParseExcel package: search.cpan.org/search?dist=Spreadsheet-ParseExcel.

However, you can only rewrite the features that Spreadsheet::WriteExcel supports so macros, graphs and some other features in the original Excel file will be lost. Also, formulas aren't rewritten, only the result of a formula is written.

按照你的需求,最好的辦法就是讀這兩個excel文件,匹配內(nèi)容,然后生成新的excel文件




歡迎光臨 Chinaunix (http://72891.cn/) Powered by Discuz! X3.2