What is the correct form to address all files having the same extension? For example, files a.txt & b.txt.

I found these forms used:

  1. .txt files

  2. txt files

  3. *.txt files

Context: I am writing a user manual for software. There is a lot about file structures, so I need a brief form of "all files with the extension txt" in expressions like:

Copy all *.txt files from folder A to folder B

Each object is stored in 5 different *.txt files

  • Please provide more context. Any or none of those might be correct depending on the situation. – Lynn Apr 17 '13 at 13:30
  • 1
    All files with the extension .txt is the clearest to me – mplungjan Apr 17 '13 at 13:31
  • With your examples, *.txt makes sense to me, however that is because I am from the DOS days. Someone dragging files off a windows explorer may have a different view of the world – mplungjan Apr 17 '13 at 13:44

In a sentence the fully correct form would be:

"All files with a txt extension" or "All .txt files."

An asterisk would make the sentence very hard to read.

| improve this answer | |
  • but the asterisk would replace "all." – rosends Apr 17 '13 at 13:35
  • 1
    I don’t like the dot in the English. In fact, I don’t like the shades-of-CP/M “txt” for “text”, either. – tchrist Apr 17 '13 at 14:00
  • 1
    The filename extension here is "txt", not ".txt", with "." being the separator between filename and extension. So if you're referencing the "extension" you ought to drop the separator. – David Aldridge Apr 18 '13 at 19:47

I'd suggest that you establish a usage convention early on that allows you to write naturally:

Note: in this document, a reference to (some type of) file" is used to mean a file with a particular file extension.

A file with this extension    will be called a ___ file:
.TXT                          text 
.BAT                          batch 
.DOC                          Word
.SLDDRW                       Solidworks

Then, you can say things like

Move all text files to the readme directory and all Word files to the recycle bin.

| improve this answer | |
  • If you're writing for nontechnical Windows users, this is important, because file extensions are probably turned off by default (so people only know files by the program that opens them). On the other hand, I use phrases like E-book (.epub) files when I'm writing for a technical audience, because they need to know both the word that we show to other people and the file extension itself. Your audience makes a huge difference in what is "correct". – aedia λ Apr 18 '13 at 20:19

The "*" is a very technical term, and I would restrict its use to only direct commands:

Type: 'copy *.txt c:\temp'

Select "*.txt" in the copy dialog.

When you're writing a sentence, you would want it to read well. Imagine someone reading it aloud:

Copy all files with the "txt" extension. -- Reads like a sentence.

The other alternatives are less desirable for various reasons:

Copy *.txt files. -- Read it aloud and it sounds goofy.

Copy all files ending in ".txt". -- Reads OK, but "txt extension" is more technically correct unless you've got some really novice users who don't know what an extension is.

Copy all *.txt files. -- Bit redundant, since "all" and "asterix" mean the same.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.