Python book recommendation list:
Tip: about how to get the file name under the directory on the Windows platform upstream. (The location of my Python book E:\Python\Python_book)
D:\>e:
E:\>CD Python
E:\PYTHON>CD Python_book
e:\python\python_book>dir/b > Name.csv
E:\python\python_book>
A name.csv file is generated under E:\Python\Python_book, which is a list of the names of the files under the directory.
A similar method under Linux can also get a list of the names of the files.
[Email protected]~] #ll-rth > Name.csv
Of course, you can blindly use awk for preliminary cropping to get a more appropriate list of file names. (however, after the CSV format, we can easily use Excel to do further processing (separated by a space to easily extract the file name list))
When we get a list of the names of the files, we can rename them in batches, which is the most useful. However, these can be handled through Excel, of course, if you feel that the lattice is not enough, you can write your own script to deal with, then Python provides a powerful text processing ability is appropriate.
Sub-platform Processing mode:
Windows platform:
Re Old_file_name new_file_name
.......
Re Old_file_name new_file_name
Then the file needs to change the name of the above side of the syntax to do, copy and paste into Notepad to save the. bat end of the file format, when we double-click to run, we want to modify the name of the file will be batch modified.
Linux platforms:
MV Old_file_name New_file_name
.......
MV Old_file_name New_file_name
Then make the sh script and execute it.
Linux has a lot of methods, here is enumerated one, if combined with regular words, may be unexpected effect, you might want to try the rename function, which need to involve the regular expression.
Python book recommendations