I need to change 100's of .htm files to .txt files, How?

robbert

Member
Oct 12, 1999
95
0
0
I used GoZilla and downloaded a few hundred .htm files. I need them to be .txt files.

What freeware, shareware will change these all at once

Thanks
 

JaiKnight

Senior member
Feb 6, 2000
958
0
0
If they're all in the same directory: Go to the command prompt, change to the directory that the htm files are in, then just do C:ren *.htm *.txt
 

robbert

Member
Oct 12, 1999
95
0
0
you said.....
If they're all in the same directory: Go to the command prompt, change to the directory that the htm files are in, then just do C:ren *.htm *.txt


Newbie here on this.
If you mean directory, does that mean folder? Yes I can put them all in the same folder.

Command prompt?
You mean from DOS?
Startup in DOS?
I have never worked from Dos commands.

Help....thanks
 

prodigy

Lifer
Oct 9, 1999
14,822
1
0
If you're using Win 98 or ME, it's MS-DOS prompt.

Win 2k, it's Command Prompt.

Directory = Folder.
 

JaiKnight

Senior member
Feb 6, 2000
958
0
0
Sorry, my fault, ok...first off, as prodigy69 said, it is from the command prompt so you'll see it just off your start menu as something like MS-DOS Prompt, so let's say you have all the htm files in C:\HTMFiles
you'd type cd\HTMFiles <press enter> to change directory to the HTMFiles directory (same as a folder in windows)
next you'd type ren *.htm *.txt <press enter> this changes all (*) files with the .htm extension to files with the .txt extension

Take note that this will change ALL .htm files in the directory, so if you don't want to change some of those files you should move them before you do the above.
 

robbert

Member
Oct 12, 1999
95
0
0
thanks
This is getting clearer

Did you mean:
cd\HTMFiles
or
c\HTMFiles

right now, I have the files on the D drive, in the folder , called stories...ALL are htm

Thanks
..........................................................
you'd type cd\HTMFiles <press enter> to change directory to the HTMFiles directory (same as a folder in windows)
next you'd type ren *.htm *.txt <press enter> this changes all (*) files with the .htm extension to files with the .txt extension
 

prodigy

Lifer
Oct 9, 1999
14,822
1
0
OK so once you're at the prompt, it will probably look like this:

C:\WINDOWS>

So what you would have to type is: (what you type in bold, what it means in italics)

1) C:\WINDOWS>D: this will change to your D: Drive
2) D:\>cd\stories cd means change directory, so this will change the directory to your stories directory
3) JaiKnight's command: D:\stories>ren *.htm *.txt this will rename the files for you

I assume you know already, but just in case you don't, you have to press Enter after each step.
 

JaiKnight

Senior member
Feb 6, 2000
958
0
0
Ok, if you have your files in the folder stories on the D drive, they would most likely be in D:\Stories so here's what you do
Get to the Command Prompt as it was shown above in the Start Menu
D: <press enter> - This changes you to the D drive
CD\stories <press enter> - to clarify CD stands for Change Directory so it was CD above, not C

*ASIDE*
The above step can be done in two seperate steps: CD\ just to get to the Root of the D drive in case you were in another sub-directory and then CD stories to get into the stories sub-directory. The single step CD\stories simply cuts down on the number of steps by getting the the root and the switching to the stories directory in one step.

Continuing:
REN *.htm *.txt - the REN command stands for Rename, this renames all the files from .htm to .txt as stated above. The asterisk (*) is a wildcard, that is it is used to list ALL files. Similarly if you wanted to find all files that started with BOB, you could type DIR BOB* and it will list all files in the current sub-directory starting with BOB. DIR is the Directory command that lists all the files in the current directory you're in. You can find help for each of these commands by typing them alone and adding a /? after them, like DIR /?

If you have any other questions feel free to ask!

BTW: for all these commands (DIR, REN, CD) it doesn't matter if they're in upper or lowercase, I just kept them in uppercase to make it clearer.
 

jaywallen

Golden Member
Sep 24, 2000
1,227
0
0
Hi,

As an aside, I just wanted to advise you that there are utilities which can convert HTML files to formatted ASCII text files. This is different from simply changing the extension of a file. You'll notice that, when you use &quot;ren *.htm *.txt&quot; that you do get text files, of a sort. (HTML means hypertext markup language. It's all text.) But you'll see a lot of gobbledygook that isn't exactly going to enhance your reading enjoyment of the page contents.

I use a command line utility called HTMSTRIP which gives you various options for removing the HTML tags from a file while still preserving various types of formatting. For instance, text formatted into tables in HTML can be pretty tough to read when you look at it with the tags still in place. Simply removing the tags will likely cause you to wind up with the text in a very &quot;non-table&quot; sort of format. HTMSTRIP can remove the tags, but keep the table format by providing space characters to maintain the intended visual formatting of the text.

There's decent documentation and an &quot;htmstrip /?&quot; help fule included with the utility. And it's freeware. If you're interested I'll try to find a trustworthy URL from which you can download it. Or, if you're the trusting type, I can email it to you. It's small.

Regards,
Jim