package Service;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
//可参见 http://baike.baidu.com/link?url=y-NVwByyOWsjM6guyVO1912JDDQMxRGXj2BsC_0Lf_1mgh87ON7ybwY_Pv2eEtUj9LqafB9IJ_l_Ha80b0BiaM9RYfTMCMSb5rFIoCuHkMC
public class Test1 {
//读入excel的文件
public static String inputFile = "tableH.1.xls";
//写入到指定的txt中
public static String outputFile = "tableH.1.txt";
//开始的行号
public static int startRowNumber = 1;
//选取的列号
public static int[] selectColNumber = {0, 1, 2, 3, 4};
public static void main(String[] args) throws IOException {
File f = new File(inputFile);
FileWriter fw = new FileWriter(outputFile);
//写入标题
用POI读取Excel表格中的值并存储为TXT文件
最新推荐文章于 2023-07-11 10:48:45 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)