当前位置:网站首页>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
- R language learning notes 1
- Numpy——1.数组的创建
- Pytorch has been installed in anaconda, and pycharm normally runs code, but vs code displays no module named 'torch‘
- Logistic regression: the most basic neural network
- 【idea】Could not autowire. No beans of xxx type found
- 2022 PMP project management examination agile knowledge points (7)
- 并查集理论讲解和代码实现
- Simple operation of nixie tube (keil5)
- I can't stand the common annotations of idea anymore
猜你喜欢
Deepin get file (folder) list
Differences between pycharm and idle and process -- join() in vs Code
HDU1231 最大连续子序列(分治or动规or双指针)
Pagoda create multiple sites with one server
HDU1232 畅通工程(并查集)
并查集理论讲解和代码实现
【idea】Could not autowire. No beans of xxx type found
Clickhouse database installation deployment and remote IP access
How to deal with excessive memory occupation of idea and Google browser
Hdu1232 unimpeded project (and collection)
随机推荐
What is Bezier curve? How to draw third-order Bezier curve with canvas?
DataGrid offline installation of database driver
Professional knowledge of public security -- teacher bilitong
MySql——存储引擎
2022年PMP项目管理考试敏捷知识点(7)
Build your own random wallpaper API for free
How to modify the file path of Jupiter notebook under miniconda
Leetcode solution - number of islands
What is soda?
Self summary of college life - freshman
Apple input method optimization
Don't confuse the use difference between series / and / *
Hdu1231 maximum continuous subsequence (divide and conquer or dynamic gauge or double pointer)
UNIX commands often used in work
How to deal with excessive memory occupation of idea and Google browser
Idea push project to code cloud
Matrix and TMB package version issues in R
Idea to view the source code of jar package and some shortcut keys (necessary for reading the source code)
Light up the running light, rough notes for beginners (1)
Anaconda pyhton multi version switching