DOS get file name in folder

DOS command window: start-cmd-enter, enter the DOS command window Case 1, get the file name dir

1. Enter "the disk where the file is located" and press Enter, such as: d:

2. Enter "cd folder location" and press Enter, such as: cd D:\web scraping

3. Enter "dir /b>filename.suffix", press Enter, such as: Dir /b>1.txt

Note: dir is the abbreviation of directory, which means: directory, which means that the list of files and subdirectories in the directory is displayed; /b means that the modification date and other information are not displayed, only the file name is displayed; file name: is the file name of the output result , you can name it arbitrarily; suffix names: xls, txt, doc, etc., respectively, indicating that the output file types are: Excel, text documents, Word, etc.; 4. Open the original folder, you will find an additional file: "file name.suffix name", which is the file with the obtained file name.

Note: Although the file names are obtained, the order is inconsistent, because the file names in the folder and the obtained file names are sorted differently. If you want one-to-one correspondence, it is best to output to Excel, adjust the data format, and then sort in a specific way; For example: the left picture is in ascending order of windows names, the right picture is in ascending order of wps text format; the left picture is sorted by numbers, and the right picture is sorted by text characters, so the results are different;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325771189&siteId=291194637