java使用apache poi 读取 doc,docx,ppt,pptx,xls,xlsx,txt,csv格式的文件示例代码 1.maven依赖添加 在 pom 文件中添加如下依赖 <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>4.1.0</version> </dependency>…
原文网址:http://www.crifan.com/files/doc/docbook/rec_soft_npp/release/htmls/npp_func_windows_unix_mac.html 第 3 章 Notepad++的功能详解   3.13. Notepad++中Windows,Unix,Mac三种格式之间的转换 由于历史原因,导致Windows,Unix/Linux,Mac三者之间,对于文件中所用回车换行符,表示的方法,都不一样. 这就导致了很多人都会遇到回车换行符的困惑,…
一.时间戳.元组时间的格式.自定义时间格式之间的转换 1.下面是三者之间的转换关系: 2.代码如下: import time import datetime print(time.time()) #获取时间戳 从 1987到现在,秒 time.sleep(1) #睡几秒 #时间戳转换成元组时间的形式 print(time.gmtime(11111)) # 把传入的时间,转换成UTC 时间 print(time.localtime(1601672134)) #把传入的时间,转换成本地时间 x=ti…
1,需要依赖的jar包, <!-- POI(operate excel) start --> <!-- the version of the following POI packages must be consistent --> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.17&…
转自:https://blog.csdn.net/angus_17/article/details/7656631 经常遇到string和date之间的转换,把相关的内容总结在这里吧: 1.string格式转化为Date对象: //把string转化为date DateFormat fmt =new SimpleDateFormat("yyyy-MM-dd"); Date date = fmt.parse(szBeginTime); test.setStartTime(date); 注…
我们知道,在 Excel 中,行数用数字表示,而列数是用字母表示的(如下图所示),有时候需要把它转换成数字来使用,或者把数字转换成字母.(例如使用POI操作Excel) 下面是转换代码,用来进行字母和数字之间的转换: /** * 将以字母表示的Excel列数转换成数字表示 * * @author WuQianLing * @param letter * 以字母表示的列数,不能为空且只允许包含字母字符 * @return 返回转换的数字,转换失败返回-1 */ public static int…
在Java中有8中基本数据类型,分别为: 整型: byte.short.int.long 浮点型:float.double 布尔型:boolean 字符型:char. byte:    8位,  封装类:Byte 1byte = 8bit;   -128~127之间所有的整数 "位"是byte,"字节"是bit 2个字节表示一个字符. 声明举例:byte a = 1; short:   16位,短整型,封装类Short,范围在(-2^15) ~ (2^15)-1 之…
前言: 1, Calendar 转化 String 2, Calendar 转化 Date 3,Date 转化 String 4,Date 转化 Calendar 5,String 转化 Calendar 6,String 转化 Date 7,Date 转化 TimeStamp 8,String 转化 TimeStamp 正文: 1, Calendar 转化 String Calendar calendat = Calendar.getInstance(); SimpleDateFormat s…
由于历史原因,导致Windows,Unix/Linux,Mac三者之间,对于文件中所用回车换行符,表示的方法,都不一样. 这就导致了很多人都会遇到回车换行符的困惑,和需要在不同格式间进行转换. 其中,关于回车换行符的详细解释,去看这里[13] 此处,介绍一下,如何通过Notepad++实现在这三者之间进行转换. 3.13.1. 查看当前文件格式(换行符用的是什么字符) 当前是Windows的平台,所以通过“显示所有字符”: 默认所查看到的是Windows的CR LF: 3.13.2. 从Wind…
数据类型转换一般分为三种: 在java中整型,实型,字符型视为简单数据类型,这些数据类型由低到高分别为:(byte,short,char--int-long-float-double) 简单数据类型之间的转换又可以分为: a.低级到高级的自动类型转换 b.高级到低级的强制类型转换 c.包装类过度类型转换 下面分别来看下这几种转换: 第一种:自动类型转换 低级变量可以直接转换为高级变量,如: byte b; int i = b; long l = b; float f = b; double d…