Sublime Forum

Convert several/multiple .txt files from UTF-8 to UTF-8-BOM

#1

hello. I need to convert several .txt files from UTF-8 to UTF-8-BOM, the files are located in *c:\Folder1*

Can this task be done with sublime text?

0 Likes

#2

It can be done manually with Sublime Text, but if you have a lot of files I suggest using a more appropriate tool like a shell or python.

0 Likes

#3

you can find 2 simple solutions here, one with a Python Script, and the other with REGEX as below:

One of them is by using REGEX:

  • Now, open the Find in Files dialog ( Ctrl + Shift + F )
    • SEARCH \A
    • REPLACE \x{FEFF}
    • FILTERS *.html
    • DIRECTORY Your SPECIFIC folder
    • Tick the Regular expression search mode
    • Click on the Replace in Files button
    • Confirm the Are you sure? dialog
0 Likes