java 写Excel工具类

本文提供了一个Java程序示例,演示如何使用特定工具类批量写入Excel文件,并实现数据行的添加。示例中包含了文件路径设置、对象创建、循环写入等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

public static void main(String[] args)
	{
		File template = new File("c:/excel/t.xls");
		File targer = new File("c:/excel/t_" + new Date().getTime() + ".xls");

		try
		{
			ExcelWrite excelUtil = new ExcelWrite(targer, template);

			for (int i = 0; i < 3; i++)
			{
				Object[] arr = new Object[] { "1", 100.5, 1, 4+i, 1F };

				excelUtil.writeALine(i + 6, arr);
			}

			// excelUtil.write(10, 0, "1000.00");

			excelUtil.submitAndClose();

		}
		catch (ExcelException e)
		{
			e.printStackTrace();
		}

		System.out.println("success");
	}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值