当前位置:网站首页>Batch modify the txt file code to UTF-8 (notepad++)
Batch modify the txt file code to UTF-8 (notepad++)
2022-07-05 07:37:00 【HAGUU】
Please like it , thank you ~Thanks*(・ω・)ノ
After two days of practice , Succeed in putting txt File from the ASCI turn UTF-8 And there is no garbled code in the text , The general steps are as follows :
- The computer has python( Previously installed ,windows Generally there are )
- Notepad++, plug-in unit - Plug-in management - install python script
- python script newly build script, Script name customization ( Such as :convertUtf8.py)
The script code is as follows :
import os;
import sys;
filePathSrc="C:\\decompile\\" # Path to the folder with files to convert
for root, dirs, files in os.walk(filePathSrc):
for fn in files: if fn[-4:] == '.htm': # Specify type of the files
notepad.open(root + "\\" + fn)
notepad.runMenuCommand("Encoding", "Convert to UTF-8") notepad.save()
notepad.close()
Related articles : The source of the above code
4. The first 3 Step by step .py The file in notepad++ open ( Such as :convertUtf8.py)
5. stay notepad++ Execute the script
Related articles : Method of execution
6. The first 5 After executing step plug-in unit -python script-scripts A new action bar is generated under “convertUtf8”
relevant :
. If you want to go from scripts Delete the script under the column , Then open the location where the script is saved , Delete file , restart notepad++ that will do
. If you want to edit this script , Press and hold ctrl And click the operation bar
7. To be transferred txt Put the file in the 3 Under the folder path mentioned in the script
8. Notepad++ Open... In 7 All the encoded documents to be transferred in step
9. Click on : plug-in unit -python script-scripts-convertUtf8
The first 9 After step execution, the file starts from notepad++ Automatically close , Code conversion succeeded .
边栏推荐
- Package ‘*****‘ has no installation candidate
- I 用c I 实现队列
- MySql——存储引擎
- Detour of Tkinter picture scaling
- Professional knowledge of public security -- teacher bilitong
- Chapter 2: try to implement a simple bean container
- DataGrid offline installation of database driver
- Explanation of parallel search set theory and code implementation
- Hdu1231 maximum continuous subsequence (divide and conquer or dynamic gauge or double pointer)
- Openxlsx field reading problem
猜你喜欢
Play with grpc - go deep into concepts and principles
Shadowless cloud desktop - online computer
When jupyter notebook is encountered, erroe appears in the name and is not output after running, but an empty line of code is added downward, and [] is empty
Today, share the wonderful and beautiful theme of idea + website address
行测--资料分析--fb--高照老师
I implement queue with C I
数字孪生实际应用案例-风机篇
Rough notes of C language (1)
How to delete the virus of inserting USB flash disk copy of shortcut to
Hdu1232 unimpeded project (and collection)
随机推荐
Numpy——1.數組的創建
Today, share the wonderful and beautiful theme of idea + website address
Charles- unable to grab bags and surf the Internet
Unforgettable summary of 2021
When jupyter notebook is encountered, erroe appears in the name and is not output after running, but an empty line of code is added downward, and [] is empty
Leetcode solution - number of islands
Package ‘*****‘ has no installation candidate
msys2
Apple script
editplus
Daily Practice:Codeforces Round #794 (Div. 2)(A~D)
Daily Practice:Codeforces Round #794 (Div. 2)(A~D)
Database SQL practice 4. Find the last of employees in all assigned departments_ Name and first_ name
Opendrive arc drawing script
Database SQL practice 3. Find the current salary details of the current leaders of each department and their corresponding department number Dept_ no
How can Oracle SQL statements modify fields that are not allowed to be null to allow nulls?
(top) pretty girl binary color code portal
arcpy. SpatialJoin_ Analysis spatial connection analysis
Openxlsx field reading problem
Apple system optimization