LIST.TXT" in the notepad file. The third step is to change the suffix name of this notepad file from "txt" to "bat". A rename dialog box will pop up, click "Yes". Step 4: Double-click the file "New Text Document.b""/> LIST.TXT" in the notepad file. The third step is to change the suffix name of this notepad file from "txt" to "bat". A rename dialog box will pop up, click "Yes". Step 4: Double-click the file "New Text Document.b"">

Home  >  Article  >  Computer Tutorials  >  Extract file names in folders in batches, read file names in batches

Extract file names in folders in batches, read file names in batches

PHPz
PHPzOriginal
2024-06-19 09:15:301031browse

Do you need to batch extract the names of files in folders? The need to read file names is very common these days, and whether it is used to organize data, create directories, or perform other tasks, extracting file names in batches is an essential skill. This article will provide you with a detailed step-by-step guide on how to extract file names from a folder using PHP code. Read on to learn how to easily batch read file names and solve your file management woes.

Sometimes it is necessary to extract some file names, but there are too many files, and copying them one by one is too slow. Now I will talk about using batch processing commands to batch extract file names in folders.

For example, there are many files in a computer folder, and you want to batch extract all the file names under this folder into a notepad file, without having to rename, copy or type by hand.

Extract file names in folders in batches, read file names in batches

#The first step is to create a new notepad file in txt format in the folder to be extracted.

The second step is to enter: "DIR *.* ?/B >LIST.TXT" in the notepad file.

The third step is to change the suffix name of this notepad file from "txt" to "bat". A rename dialog box will pop up, click "Yes".

The fourth step is to double-click the file "New Text Document.bat" to generate the list.txt file. Open the txt file and you can see a list of all file names in the current folder. (Warm reminder: You can also put the file "New Text Document.bat" in other folders and run it to get all the file names under the current folder!)

Extract file names in folders in batches, read file names in batches

The method of extracting the file name in the folder is to save the file to the directory where the file name is to be extracted, save it as *.bat (* is the file name), and then double-click to execute it. Isn’t it convenient, fast and practical? For more computer knowledge, please pay attention to 20HN~

The above is the detailed content of Extract file names in folders in batches, read file names in batches. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn