5

I have 50 text files which need to be converted from utf-8 bom to ANSI. In Notepad++ We can do it with single file, but I want all opened files to be converted to ANSI in one short way. Is there any option there?

2
  • It seems that u need a way in command line to do it. Have you looked for a powershell solution? Commented Dec 29, 2016 at 11:11
  • i did not try., im not a power user or script writer. just looking for a tool that could do this job. any other way?. if it can be done in command line please let me know how to do it.
    – Abd
    Commented Dec 29, 2016 at 19:54

1 Answer 1

2

Suppose that your utf8bom files are in c:\temp\utf8\

I am saving the ansi files to c:\temp\ansi\

At command line,

> powershell
PS> get-item c:\temp\utf8\*.* | foreach-object {get-content $_ | out-file ("c:\temp\ansi\" + $_.Name) -encoding default}
PS> exit
>

What it does is that for each file in c:\temp\utf8, get its content and output to a file with the same filename in c:\temp\ansi with the Windows system default encoding, which is equivalent to ANSI you meant.

get-content command here can read the text without you specifying utf8 with or without bom.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .