Python Book recommendation, python book
Python Book recommendation list:
Tip: Learn how to obtain the file name under the directory on the windows platform. (My python book location 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>
In this case, a name.csv file is generated under E: \ Python \ python_book. its content is the file name list under the directory.
You can obtain the file name list in a similar way in linux.
[Root @ localhost ~] # Ll-rth> name.csv
Of course, you can use awk for preliminary cropping to obtain a more appropriate list of file names. (However, after saving it in CSV format, we can easily use EXCEL for further processing (separated by spaces, we can easily extract the file name list ))
After obtaining the file name list, we can batch rename it. This is the most useful. However, these can be processed through EXCEL. Of course, if you feel that the limit is not enough, you can write your own scripts for processing. Therefore, Python provides powerful text processing capabilities.
Sub-platform processing mode:
WINDOWS:
Re old_file_name new_file_name
.......
Re old_file_name new_file_name
Then, copy and paste the syntax format of the above edge of the file name to be changed to notepad and save it. the format of the file ending with bat. When we double-click the file, the names of the files we want to modify will be modified in batches.
LINUX platform:
Mv old_file_name new_file_name
.......
Mv old_file_name new_file_name
Run the sh script.
There are a lot of methods in linux. Here we will enumerate one. If combined with regular expressions, it may have unexpected results. Try the rename function, which involves regular expressions.