batch execution
-
I would like to step thru a directory of 500 files,
open a file,
convert it to UTF-8,
save the file then close it,
repeat for the next file.
Any ideas? -
Maybe some ideas HERE as someone yesterday seemed to be trying to do a very similar thing.
But… encoding detection in Notepad++ is just a guess, not an absolute, so you might detect some files wrongly.
I don’t know…sounds dangerous to me… -
@Manfred-Humphries said in batch execution:
would like to step thru a directory of 500 files,
open a file,
convert it to UTF-8,
save the file then close it,
repeat for the next file.Why would you use Notepad++ for this?
Second hit on Google “powershell convert file to utf-8”:
https://superuser.com/questions/1163753/converting-text-file-to-utf-8-on-windows-command-promptGet-Content .\test.txt | Set-Content -Encoding utf8 test-utf8.txt
Next, Google “loop through files in directory powershell”. Seems like:
Get-ChildItem "FULL_PATH_TO_DIRECTORY_WITH_ALL_YOUR_FILES" | Foreach-Object { Get-Content $_ | Set-Content -Encoding utf8 $_.utf8}
Then all your
*.utf8
files can be filtered / moved / copied whereever.I MAKE NO GUARANTEES THIS WORKS!!! PROBABLY MAKES SENSE TO COPY YOUR 500 FILE FOLDER BEFORE STARTING AND THEN OPERATE ON THE COPY JUST IN CASE!!!
Cheers.
-
I used to write batch files and coldfusin apps, but that was long ago and far from my present mental haze… Thanks, but it looks like I’m going to load and save each file.