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 ...
随机推荐
- 网站检测空链、死链工具(Xenu)
网站常用检测空链.死链工具,Xenu是很小但是功能强大的检查网站404链接的软件,支持多线程,无需安装可直接打开使用.步骤如下: 网站的链接一般都成千上万,如果存在大量的空链接将大大的影响用户体验,怎 ...
- jupytext library using in jupyter notebook
目录 1. jupytext features 2. Way of using 3. usage 4. installation 1. jupytext features Jupytext can s ...
- 《BUG创造队》作业8:软件测试与Alpha冲刺(第五天)
项目 内容 这个作业属于哪个课程 2016级软件工程 这个作业的要求在哪里 实验十二 团队作业8:软件测试与ALPHA冲刺 团队名称 BUG创造队 作业学习目标 (1)掌握软件测试基础技术.(2)学习 ...
- 神经网络(4)---神经网络是如何帮助我们学习复杂的nonlinear hypotheses
神经网络是如何一步步进行计算的,以及对计算过程的向量化 Z1(2),Z2(2),Z3(2) are just weighted linear combination of input value x1 ...
- 【Python学习】Python3 基础语法
==================================================================================================== ...
- vs2010出现红色波浪错误提示但运行通过
1.环境:xp+VS2010 2.问题:突然发现编辑器里的代码在没有错误的地方提示很多不存在的错误,显示红色波浪线,但能顺利编译运行. 3.解决: 对于32位机来说,先查看注册表: [HKEY_CLA ...
- ubuntu下subversion1.7的安装
环境: ubuntu11.10 subversion1.7 1.用synaptic安装的svn都是1.6版,根本于现在的主流svn服务器无法通信.需要升级为1.7. 1.1 apt-add-repos ...
- sentinel主从切换技术
主从切换技术的方法是: 当主服务器宕机后,需要手动把一台从服务器切换为主服务器, 这就需要人工干预,费事费力,还会造成一段时间内服务不可用. 这不是一种推荐的方式,更多时候,我们优先考虑哨兵模式. 一 ...
- 0.0.Pycharm使用技巧
调整自动字体大小 Increase(字体变大) Decrease(字体变小) 背景颜色设置 pycharm 左侧菜单问题 解决 pycharm中配置启动Django项目 1.先打开mange.py,然 ...
- 4:ELK分析tomcat日志
五.ELK分析tomcat日志 1.配置FIlebeat搜集tomcat日志 2.配置Logstash从filebeat输入tomcat日志 3.查看索引 4.创建索引