-1

I have a list of .out extension file(about 100 of it) and i want to convert them into .txt file.

I can do it using wordpad to open them and then save it as .txt manually.

However, it is too time consuming. There have to be some lines for me to do that so I can loop it to convert all the file.

  • 3
    It would be nice if you posted some code you already have and list the issues you have with that so that community can help you. [so] is not free code writing service so showing your effort will increase chances for getting good answers. – Robert Dyjas Oct 09 '19 at 09:44
  • "convert" (= change the format of the file content) or "rename" (keep the file as is, but change the extension)? – Stephan Oct 09 '19 at 17:24

1 Answers1

0

Here are 2 scenarios:

if the files are all inside the same dir open cmd.exe and browse to the directory and run:

 ren *.out *.txt

If the files are located in subfolders:

 for /r %i in (*.out) do echo ren "%~fi" "%~dpni.txt"

the above line can be save to a batch file as well, you simply double up on the %, this example also predefines a path.

for /r "Z:\Documents" %%i in (*.txt) do echo ren "%%~fi" "%%~dpni.txt"
Gerhard
  • 22,678
  • 7
  • 27
  • 43