Java统计文件数量
Java统计文件数量
package com.vfsd; import java.io.File;
import java.io.IOException; /*******************************************************************************************************
* Copyright: vc1.0 2018. All rights reserved. <br>
* The whole package including this class is licensed under <br>
* <br>
* @ClassName: <br>
* @Directory: <br>
* @author: luozhubang <br>
* @version: v1.0.0 <br>
* @date: <br>
* @Description: <br>
* 1、 <br>
* 2、 <br>
* @Others: 暂无说明 <br>
* @Modification History: <br>
* 1、 <br>
* Date: <br>
* Author: <br>
* Modification: <br>
* <br>
* 2、 <br>
* Date: <br>
* Author: <br>
* Modification: <br>
*
* @Statement: If you are using the package or parts of it in any commercial way, a commercial license is required. <br>
* Visit <a href='http://www.bim-times.com'>http://www.bim-times.com</a> for more information.<br>
*
*********************************************************************************************************/
public class CountFileNum {
private static int count1 = 0;
public static void main(String[] args) throws IOException{
String dir1="E:\\20190418_relationdata4\\"; listFiles(dir1);
} public static void listFiles(String filePath) throws IOException{
File dirFile = new File(filePath);
if(dirFile.isDirectory()) {
File[] files1 = dirFile.listFiles();
for(int i=0;i<files1.length;i++) {
countNum(files1[i].getPath());
System.out.println("count:"+count1+" "+files1[i].getName());
count1=0;
}
}
} public static void countNum(String filePath) throws IOException{
File dirFile = new File(filePath);
if(dirFile.isDirectory()) {
File[] files1 = dirFile.listFiles();
for(int i=0;i<files1.length;i++) {
if(files1[i].getName().endsWith("02.txt")) {
count1++;
}
} }
} }
Java统计文件数量的更多相关文章
- java 统计文件注释个数
参考:https://segmentfault.com/q/1010000012636380/a-1020000012640905 题目:统计文件中//和/* */注释的个数,双引号中的不算 impo ...
- java统计文件字母大小写的数量练习
import java.io.*; import java.lang.*; public class WordStatistic { private BufferedReader br; privat ...
- linux 统计文件数量
查找当前目录下compose文件的数量 ls -lr | grep "compose" | wc -l
- Java统计文件中字母个数
import java.text.DecimalFormat; import java.io.File; import java.io.FileReader; import java.io.Buffe ...
- dir 使用,统计文件数量
dir /b /a-d | find /v /c "$$$$" >1.log--※ 来源:·水木社区 newsmth.net·[FROM: 125.46.17.*] 今天去水 ...
- Storm监控文件夹变化 统计文件单词数量
监控指定文件夹,读取文件(新文件动态读取)里的内容,统计单词的数量. FileSpout.java,监控文件夹,读取新文件内容 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
- 利用Clojure统计代码文件数量和代码行数
;; 引入clojure的io包 (use '[clojure.java.io]) ;; 遍历目录将所有符合要求的文件做为列表返回 (defn walk [dirpath pattern] (doal ...
- Linux统计文件/目录数量ls -l | grep "^-" | wc -l匹配开头和结尾
Linux统计文件数量 ls -l | grep "^-" | wc -l “^-” 一般文件 “^d” 目录文件 shell/vim中^表示开头 cat repatterns ...
- Linux统计文件/目录数量ls -l | grep "^-" | wc -l匹配开头和结尾,wc -c统计字符串长度
Linux统计文件数量 ls -l | grep "^-" | wc -l “^-” 一般文件 “^d” 目录文件 shell/vim中^表示开头 cat repatterns ...
随机推荐
- tomcat访问manager
在配置好Tomcat7/8后,我们往往需要访问Tomcat7/8的Manager以及Host Manager.就需要在tomcat-users.xml中配置用户角色来实现.在地址栏输入:localho ...
- Python练习题---判断回文数
设n是一个任意自然数,如果n的各位数字反向排序所得的自然数与n相等,则n被称为回文数,从键盘输入一个5位数字 ,请编写程序判断这个数字是不是回文数. 思路:先获取一个字符串,再判断该字符串是否满足是自 ...
- Redis-3.2.1集群内网部署
摘要: Redis-3.2.1集群内网部署 http://rubygems.org国内连不上时的一种Redis集群部署解决方案.不足之处,请广大网友指正,谢谢! 一. 关于redis cluster ...
- learning java AWT Pannel
import java.awt.*; public class PanelTest { public static void main(String[] args) { var f = new Fra ...
- am335x system upgrade kernel f-ram fm25l16b(十六)
1 Scope of Document This document describes SPI F-RAM hardware design 2 Requiremen 2.1 ...
- 43、内置函数及每日uv、销售额统计案例
一.spark1.5内置函数 在Spark 1.5.x版本,增加了一系列内置函数到DataFrame API中,并且实现了code-generation的优化.与普通的函数不同,DataFrame的函 ...
- svg坐标转换
本文内容转自 how-to-translate-from-dom-to-svg-coordinates-and-back-again svg coordinate system Why we need ...
- Adobe Acrobat DC
DC: document cloud [云服务] 但是Adobe document cloud包括: Acrobat DC, Adobe sign, 以及Web和移动应用程序. 参考: https:/ ...
- Kafka 深入核心参数配置
Kafka 真是一个异常稳定的组件,服务器上我们部署了 kafka_2.11-1.0.1 版本的 kafka 除了几次计算时间太长触发了 rebalance 以外,基本没有处理过什么奇怪的问题. 但是 ...
- C# 坦克大战笔记(1)
1.游戏对象父类:GameObject 成员: 游戏对象的X,Y坐标,高度,宽度,方向,对象,以及生命值. 绘制游戏对象的抽象方法Draw(); 绘制对象移动的方法Move() 返回矩形的方法,用于碰 ...