nokiaxls.java

来自「this code explains about the database co」· Java 代码 · 共 50 行

JAVA
50
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package com.wwr.commons;import java.io.File;import jxl.Cell;import jxl.Sheet;import jxl.Workbook;/** * * @author user */public class NokiaXLS {    public NokiaXLS(){        try{             File inputWorkbook = new File("");            Workbook w;            String strCell = "";            w = Workbook.getWorkbook(inputWorkbook);            // Get the first sheet            Sheet sheet = w.getSheet(0);            // Loop over first 10 column and lines                        for (int i = 0; i < sheet.getRows(); i++) {                for (int j = 0; j < sheet.getColumns(); j++) {                    Cell cell = sheet.getCell(j, i);                    String cellContent = cell.getContents() ;                    if(cellContent.equals(null) || cellContent.equals("")){                    }else{                        strCell = strCell +cellContent+  "#";                    }                }                System.out.println(strCell);                System.out.println(" --------------------------");                strCell = "";            }        }catch(Exception e){            e.printStackTrace();        }    }        public static void main(String[] args){            }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?