今天,别人提问日期格式不规范,格式各样,中间的内容都不同,怎么处理方便。
想了想还是用Split的正则表达式处理方便且易于扩充,只要正则表达式不断扩充就行了。
代码如下:
public static void main(String[] args) {
String[] arr = new String[]{"2015年1月1日","2015-1-1","2015/1/1","2015/...
分类:
其他好文 时间:
2015-05-26 18:46:39
阅读次数:
157
os.listdir()os.path.isdir()os.path.split()返回一个路径的目录名和文件名os.path.dirname()os.system()os.mkdir("file")os.chdir("C:\\123")importos,sys
os.chdir("f:\\51cto")
forlistsinos.listdir(‘.‘):
ifos.path.isdir(lists):
list1="d:\\muban\\"+lists
os.mkdi..
分类:
编程语言 时间:
2015-05-26 16:22:40
阅读次数:
204
Hadoop旧版中InputSplit的个数由下面三个参数决定:
goalSize:totalSize/numSpilt.totalSize为文件大小,numSplit为用户设定的map task个数,默认为1.
minSize:InputSplit的最小值,由配置参数 mapred.min.split.size,默认为1.
blockS...
分类:
其他好文 时间:
2015-05-26 12:47:23
阅读次数:
218
linux文件分割(将大的日志文件分割成小的)linux下文件分割可以通过split命令来实现,可以指定按行数分割和安大小分割两种模式。Linux下文件合并可以通过cat命令来实现,非常简单。 在Linux下用split进行文件分割: 模式一:指定分割后文件行数 对与txt文本文件,可以通过指...
分类:
系统相关 时间:
2015-05-25 18:06:18
阅读次数:
172
``` String name = ManagementFactory.getRuntimeMXBean().getName(); System.out.println(name); // get pid String pid = name.split("@")[0]; System.out.println("Pid is:" + pid); ```...
分类:
编程语言 时间:
2015-05-25 14:57:48
阅读次数:
128
//求每个字符串出现的次数 $str="sdfgfdas323344##$\$fdsdfg*$**$*$**$$443563536254fas"; //解法一 $arr = str_split($str); $arr = array_coun...
分类:
其他好文 时间:
2015-05-25 12:46:53
阅读次数:
87
1、split 分割2、内置函数 __name__ ------- 主动执行还是被其他程序调用; 本程序内 __name__ 值为 __main__ ;其他程序调用时,__文件名____file__ ======当前文件路径、是文件的相对路径__doc__ ======当前程序说明文档3、函数 de...
分类:
数据库 时间:
2015-05-24 20:22:07
阅读次数:
190
判断产品版本号的大小。public class Solution { public int compareVersion(String version1, String version2) { String[] v1 = version1.split("\\."); ...
分类:
其他好文 时间:
2015-05-24 20:15:34
阅读次数:
102
Divideing Jewels时间限制:1000ms | 内存限制:65535KB难度:4描述Mary and Rose own a collection of jewells. They want to split the collection among themselves so that ...
分类:
其他好文 时间:
2015-05-24 18:50:45
阅读次数:
144
1. Understanding MVC patternIn high-level terms, MVC pattern means that application will be split into three pieces:(1) Model, which contains the data...
分类:
Web程序 时间:
2015-05-24 11:30:10
阅读次数:
159