tag 标签: 工作表经管大学堂:名校名师名课

相关帖子

版块 作者 回复/查看 最后发表
Excel—“撤销工作表保护密码”的破解并获取原始密码 attachment Excel zangtt 2012-2-27 22 17296 黄儿艺 2021-8-19 17:05:28
悬赏 如何将多个excel工作表中的数据导入matlab - [悬赏 10 个论坛币] MATLAB等数学软件专版 空间经济地理 2013-1-21 3 16137 颜值高非吾错 2016-7-19 20:35:56
求教:批量新建Excel工作表 Excel yellowsubmarine 2011-11-17 4 16886 matlab-007 2016-6-28 18:53:25
如何把几个excel文件中的工作表合并到一个文件中并生成目录 attachment Excel gtliuhuigui 2012-2-26 3 7389 matlab-007 2016-6-17 19:25:36
请问如何实现excel多张工作表sheet按第一列日期排序,而第二列的数字也随着变化呢 attachment Excel tracy272523 2013-5-9 14 17859 白夫长 2014-1-2 21:07:35
Excel—“撤销工作表保护密码”的破解--分享学习 Excel HN-yifan 2013-8-1 0 1339 HN-yifan 2013-8-1 14:34:50
EXCEL中逐步输入提示,,想百度搜索框一样的功能 休闲灌水 theundead 2013-5-25 0 9640 theundead 2013-5-25 04:01:31
悬赏 如何用宏求两个有空值的数组的差? - [悬赏 5 个论坛币] Excel summerrain3399 2013-3-15 13 2355 controlpanel 2013-5-6 17:25:26
两个含有空值的数组如何用宏实现求差? Excel summerrain3399 2013-3-15 0 976 summerrain3399 2013-3-15 14:52:32
clementing合并数据 attach_img 数据分析与数据挖掘 sn8201 2013-3-14 2 1298 jswu167 2013-3-15 10:20:25
如何将多个excel工作表中的数据导入matlab? MATLAB等数学软件专版 空间经济地理 2013-1-21 1 1352 tulipsliu 2013-1-21 20:55:15
循环构建新矩阵 attach_img Excel gaizi123301624 2012-4-15 1 1422 fin9845cl 2012-4-17 08:55:13
EXCEL应用(转载) Excel 细菌虫 2012-3-18 2 1469 夏少锋 2012-3-18 11:50:00
EXCEL 的密码保护的去除的VBA程序 年鉴数据自由编辑 Excel 匿名 2012-2-12 4 3530 cc457921 2012-2-19 11:35:01
悬赏 sas能将多个结果输出到一个excel工作簿里么 - [!reward_solved!] SAS专版 yumenderen 2011-11-18 4 3370 こうえき 2011-11-20 19:20:04
悬赏 统计学教材当中的问题求助(中国人大贾俊平主编) - [悬赏 5 个论坛币] attachment Excel JeffreyLin_19 2011-11-13 3 3157 thlkk 2011-11-13 16:28:30
如何对大量Excel工作簿里的工作表名进行批量重命名? Excel lxhyk 2010-11-15 0 6856 lxhyk 2010-11-15 18:31:26

相关日志

分享 用R读取Excel的新方法
lanruomuyu 2013-4-14 20:31
用R读取Excel的新方法 还在纠结用如何用R读取Excel的同学有福了。昨天逛CRAN的时候发现了一个xlsx包,它给出的介绍是可以读取、写入Excel 2007/2003文件并支持格式的设置。简单地来说,将Excel读取为数据框,以及将数据框写入为Excel文件都不是问题,而更加强大的是它能处理 Excel中的格式,比如合并单元格,设置列的宽度,设置字体和颜色等等。 如果只需要基本的读取/写入操作,那么其中的read.xlsx()和write.xlsx()应该就能满足大部分的需求了,其用法也很简单,看看帮助文档就了解了。此外,还有两个相应的函数read.xlsx2()和write.xlsx2(),按作者的话说,这两个函数使用了不同的实现方式,效率上会更高一些。 除了基本的读写操作之外,如之前所说,xlsx包还能进行格式方面的设置。下面是一个简单的例子,说明了如何创建工作簿和工作表,如何操作单元格等。感兴趣的朋友不妨运行一下下面的例子,看看最终的效果。 ind = read.table(url("http://yixuan.cos.name/cn/wp-content/uploads/2012/01/ind.txt"), sep = "\t"); library(xlsx); # Create a new workbook wb = createWorkbook(); # Create a new sheet with a name sheet1 = createSheet(wb, "第一页"); # Set the zoom ratio when you open the Excel file setZoom(sheet1, 50, 100); # Set the width of columns setColumnWidth(sheet1, 1:100, 2.8); # Create rows rows = createRow(sheet1, 1:40); # Create cells for each row cells = createCell(rows, 1:73); # Merge the first row into one cell addMergedRegion(sheet1, 1, 1, 1, 73); # Create the style for title cell title_cell_style = CellStyle(wb, alignment = Alignment(horizontal = "ALIGN_CENTER"), font = Font(wb, "blue", 50, isBold = TRUE)); # Create the style for black cells black_cell_style = CellStyle(wb, border = Border(), fill = Fill(foregroundColor= "black")); # Get the first row first_row = getRows(sheet1, 1); # Get the title cell from first row title_cell = getCells(first_row, 1) ]; # Set the value of the title cell setCellValue(title_cell, "Read/Write Excel!"); # Set the style of the title cell setCellStyle(title_cell, title_cell_style); # Set the style of black cells tmp = mapply(function(x, y) setCellStyle(cells ], black_cell_style), ind 3, ind 5); # Save the workbook into a file saveWorkbook(wb, "test.xlsx"); 总的来说,xlsx包是我目前见过的功能最全的操作Excel的R包,它只依赖于Java环境和rJava、xlsxjars两个包,在多种平台下 都能运行,局限是写操作只支持Excel 2007格式(*.xlsx),对于机器上只有MS Office 2003的人来说可能会有些不便。(LibreOffice和OpenOffice.org都可以打开Excel 2007文件)
个人分类: 技术经验|26 次阅读|0 个评论

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-2 01:38