批量获取Word文档的文件名信息
来源:互联网 发布:英语文献翻译软件 编辑:程序博客网 时间:2024/06/05 00:18
在日常工作中,当我们需要批量获取文档的文件名信息时,可以通过程序完成,减轻了人工的工作量。
首先需要将所有文档放在同一个文件夹中,并得到该文件夹的存放的路径path,然后在利用程序获取信息。我们采用java语言,具体实现代码如下:
import java.io.File;
/**
* @author yinxm
* @version 1.0 2005/06/17
*
* This class can take file's path and file's name;
* you must give the path where you want to take the file.
*/
public class Test{
public static void main(String[] args) {
// This is the path where the file's name you want to take.
String path = "C://Users//Administrator//Desktop//sjk";
getFile(path);
}
private static void getFile(String path){
// get file list where the path has
File file = new File(path);
// get the folder list
File[] array = file.listFiles();
for(int i=0;i<array.length;i++){
if(array[i].isFile()){
// only take file name
System.out.println(array[i].getName());
// take file path and name
System.out.println("#####" + array[i]);
// take file path and name
System.out.println("*****" + array[i].getPath());
}else if(array[i].isDirectory()){
getFile(array[i].getPath());
}
}
}
}
此时我们有多个输出结果懿满足不同的输出要求。
- 批量获取Word文档的文件名信息
- word文档摘要信息的获取
- 快速获取批量文件文件名的方法
- ASP.NET C#如何读取word,写入word,复制内容到另一个word文档,批量修改文件名
- 批量分割Word文档
- 批量合并word文档
- 批量合并word文档
- stat() -- 通过文件名获取文件的信息
- 批量提取文件名到txt文档的方法
- POI应用:利用word模板批量生成word文档(java中word文档的读写)
- 对word文档编程,以及从模板文档批量生成新的word文档。
- Windows下批量采集/获取文件名的方法
- 简单一招用BAT批量获取和修改文件名的方法
- 获取Word文档的作者和主题
- 获取Word文档的作者和主题
- 获取Word文档的作者和主题
- 获取Word文档的作者和主题
- word文档批量合并工具
- LINUX搭建远程VNC桌面
- 理解display:box 和 display:flex
- python获取文件路径下的完整文件名(包括扩展名)
- epoll服务器
- 深度学习之OCR(一)——多数字识别_Multi-digit Number Recognition
- 批量获取Word文档的文件名信息
- mysql常用语法
- linux less命令简介
- 从零开始学习音视频编程技术(31) Linux篇之hello world
- irp的异步完成_irp等待插入队列_删除队列_结束irp
- 洛谷 P3819 松江1843路
- 禁止微信下拉
- 面向对象(一)
- 正则