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

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
Spread Privacy
Spread Privacy
I
InfoQ
V
V2EX
S
Schneier on Security
小众软件
小众软件
C
CERT Recently Published Vulnerability Notes
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
The Hacker News
The Hacker News
S
SegmentFault 最新的问题
C
Cybersecurity and Infrastructure Security Agency CISA
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Latest news
Latest news
S
Secure Thoughts
Project Zero
Project Zero
MongoDB | Blog
MongoDB | Blog
I
Intezer
Security Latest
Security Latest
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
N
Netflix TechBlog - Medium
V2EX - 技术
V2EX - 技术
量子位
T
Threatpost
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
T
Tor Project blog
A
Arctic Wolf
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
博客园 - Franky
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
L
LINUX DO - 热门话题

博客园 - 谁是菜鸟?

mysql数据区分大小写 css hack java 乱码 panic user 44/45 Lock wait timeout exceeded; try restarting transaction window.onbeforeunload(支持firefox,ie,Safari) 配置SFS2.x的调试环境 mysql异常处理 常用linux命令 x86_64-unknown-linux - 谁是菜鸟? - 博客园 mysql 动态sql memcached资料 js ping - 谁是菜鸟? - 博客园 mysql roll back 为没有自动增长列的表添加自动增长列并更新现有数据 SmartFox Server 控制pubMsg - 谁是菜鸟? mysql 命令 java.util.ConcurrentModificationException RenRen应用接入样例 - 谁是菜鸟? - 博客园
jxl read and write excel
谁是菜鸟? · 2009-09-09 · via 博客园 - 谁是菜鸟?

read:
try{
    Workbook workbook = Workbook.getWorkbook(new File(path));
    Sheet sheet = workbook.getSheet(0);
    int rows=sheet.getRows();
    //System.out.println(rows);
    int col=sheet.getColumns();
    //System.out.println(col);
    for(int i=1;i<rows;i++)
    {
      for(int j=0;j<col;j++)
      {
            System.out.println(sheet.getCell(j,i).getContents());
            //can create your own model data from excel
      }
    }
    workbook.close();
   }catch(Exception e)
   {
    e.printStackTrace();
   }
   ---------------------------------------------------------------------
write excel :
try    {  
   WritableWorkbook book  =  Workbook.createWorkbook(new File(path));  
   
    WritableSheet sheet  =  book.createSheet( "新生信息统计" ,0 );   
    //can write data from model list
    //write string
    Label label0  =   new  Label( 0 ,  0 ,  "学生编号" );
    sheet.addCell(label0);  
    //write number 
    jxl.write.Number number  =   new  jxl.write.Number( 0 ,  1 , 1);
    sheet.addCell(number);  
    book.write();   
    book.close();  
 }   catch  (Exception e)   {  
           System.out.println(e);   
}