惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
Vercel News
Vercel News
月光博客
月光博客
S
SegmentFault 最新的问题
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
U
Unit 42
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
N
Netflix TechBlog - Medium
小众软件
小众软件
WordPress大学
WordPress大学
G
Google Developers Blog
Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
博客园 - 【当耐特】
I
InfoQ

博客园 - 乐军

./upload/source/class/class_core.php ./upload/index.php ./upload/forum.php 仅个人兴趣,自己通过搜索他人的成果,结合自己的理解,来分析discuz的代码。 Windows 系统的进程中, svchost.exe是做什么的? 如何切断已有的网络连接 Excel 得出字符串最后一个符号的位置 - 乐军 - 博客园 双击文件夹或某个分区,打开时会弹出新的对话窗口,解决办法! [原创] 如何在xp下安装DNS? System Volume Information文件夹是什么? windows下的一些隐藏文件 pagefile.sys文件是什么? MSOCache文件夹是什么? java与Excel (2) java与Excel (1) DOS 命令 批处理文件常用命令及其用法(2) 批处理文件常用命令及其用法 QTP测试脚本的大致层次结构
java与Excel (3)
乐军 · 2006-07-24 · via 博客园 - 乐军

利用java excel api 修改一个excel文件。

package modifyexcel;
import java.io.File;
import java.io.IOException;

import jxl.*;
import jxl.read.biff.BiffException;
import jxl.write.*;

public class Modifyexcel {

 public static void main(String[] args) throws BiffException, IOException, WriteException {
  Workbook srcxls = Workbook.getWorkbook(new File("E:\\java-SRC\\ExcelAPILearning\\myfile.xls"));
  WritableWorkbook copy = Workbook.createWorkbook(new File("E:\\java-SRC\\ExcelAPILearning\\output.xls"),srcxls);
  WritableSheet sheet1 = copy.getSheet(0);
  WritableCell cell1 = sheet1.getWritableCell(0,0);
  if (cell1.getContents().length()==0){
   Label labelcell = (Label) cell1;
   labelcell.setString("haha");
  }
  Label label = new Label(0,3,"xixi");
  sheet1.addCell(label);
  copy.write();
  copy.close();
 }
}