All Posts Tagged With: "filename"

Demystifying Modern Filename Extensions

A filename extension is a suffix to a filename. There’s the name of the file itself, then a period, then the extension. When you see Document.pdf, the ".pdf" is the extension. The filename extension is one of those things that’s a necessary evil in computing to differentiate one type of file from another.

Some UNIX/Linux environments purposely use specific extensions for the sake of convenience because they’re technically not required. For example, the Debian distribution uses files that end with .deb to represent a Debian software package. When you see a file that ends with .deb, you instantly know what it is. You can consider filename extension use in a UNIX/Linux environment to be more of a descriptor (i.e. metadata) than anything else.

The Windows environment requires filename extensions to operate. Traditional extensions do not exceed three characters. For those of you thinking, "Isn’t is true all file types in Windows use three-character filename extensions?" Not necessarily. 7-Zip for example uses the two-character .7z by default, and several programming languages use one or two-character extensions.

Common filename extensions that confuse people as to what they are

Some extensions are really easy to figure out because they’re part of a word.

Examples: TXT (TeXT), DOC (DOCument), BAT (BATch script file), COM (COMmand), WAV (WAVe sound file), SH (SHell)

Then there are those that are abbreviations, like PDF (Portable Document Format).

But then there are those that do nothing but confuse people because they don’t know what they are. Here’s a few should you encounter them:

M3U and PLS

These are both file types that represent a multimedia playlist. Many get confused when they encounter these because they think there’s actual audio within them. Not true. They are small "pointers" to other audio files (such as MP3) either local to your computer and/or on the internet.

The super-long title for M3U is "Moving Picture Experts Group Audio Layer 3 Uniform Resource Locator". Try and say that 5 times fast.

PLS to the best of my knowledge means either PLaylistS or PLay Stream, although I could be mistaken (and if I am, feel free to correct me by posting a comment).

ODT

This is a file type that that is slowly becoming recognized in mainstream use, that being the OpenDocument Format. The T is for text. There is also ODS with S for spreadsheet, ODP with P for presentation, ODG with G for graphics and ODF with F for formulae (mathematical equations).

Most people know ODT files from using the freely available OpenOffice suite. The ODT format by the way is compatible with Google Docs if you don’t have software to read them.

RAR

Most people know what this is but there are still a few that don’t. It’s a Roshal ARchive. This is an archive format like ZIP. If you want to open one, use 7-Zip or WinZIP (paid software). If you want to create one, use WinRAR (also paid software).

FLV

FLash Video. If you want to view an FLV video independently (meaning not in your web browser), use the freely available VLC.

FLAC

Free Lossless Audio Codec; an audio file type that sounds better than MP3 because it is lossless while MP3 isn’t. To play them you can use Windows Media Player or the freely available WinAMP.

3GP and 3G2

Both of these are usually video file formats and part of the 3GPP standard. You will usually only encounter these when someone sends you a video file via a cell phone. Windows Vista and 7 will view these via Windows Media Player. If using XP, use Apple QuickTime.

M4A and MP4

Both are MPEG-4 Part 14.

Both file types can be either audio or video. While it’s true that most files ending in .m4a are audio-only, it doesn’t mean they have to be.

Windows Media Player 12 – which is bundled with Windows 7 – will play this format. For older versions of Windows you can use Apple QuickTime or the freely available VLC.

OGG

A newer multimedia file format. It can be audio or video. This format can be opened and played on many different programs, including the freely available VLC.

Older file types you may encounter

What’s listed below isn’t in mainstream use any longer, but should you encounter them you’ll at least know what they are and how to deal with them.

ARJ

An archive file type like ZIP and RAR.

ARJ is Archived by Robert Jung. This file type was actually quite popular during the 1990s and at one point gave ZIP some really good competition. 7-Zip is able to open these.

WPS

This is a proprietary document format used by the Microsoft Works when you save a document with it. It is the file extension everybody hates because nobody can open them that doesn’t have Works.

Fortunately you can do a Save as in Works and save in DOC format, but most people who use Works do not do that. And if you use Works, I strongly urge that you always save in DOC and not WPS – especially if you’re sending documents to other people.

Got a bunch of WPSes and need to convert them? Use Zamzar to do it. (WPS conversion, thankfully, is supported.)

TIF or TIFF

This is an image file type. It stands for Tagged Image File Format. Most image editors can easily open TIFF files, including the Windows Picture and Fax Viewer which is included with the Windows OS.

If for whatever reason you have a problem (which you shouldn’t) opening a TIFF, use the freely available GIMP software.

RTF

This is Rich Text Format, a document type developed by Microsoft way back in 1987. It is still, even in Windows 7, used as the default file type when saving from it’s bundled word processing application WordPad.

For older generation computer users, RTF sticks out like a sore thumb due to the fact so many people used Windows Write (the predecessor to WordPad). But many newer generation users have never seen RTF files.

Shades of the past: Using the Start/Run dialog in Windows 7, if you type write and click OK, WordPad will load up.

The Ultimate Guide To Proper Date Formatting In File Names

This guide is for anybody that has a whole bunch of files, be they photos, MP3s, documents or any other type of file you have that needs quick-sorting by date at a glance.

There is only one right way to put the date in a file name. When I say "date in a file name" I mean that the actual title of the file has the date in it.

The format you must use for proper date formatting every time is:

  1. Four-digit year
  2. Dash
  3. Two digit month or single digit month with leading zero
  4. Dash
  5. Two digit day of month or single digit day of month with leading zero
  6. Underscore
  7. Description of file in lowercase letters with words separated by underscores (optional, but more compliant)

Here’s an example:

2009-03-27_my_document.doc

Now I’m going to explain why this is the proper date formatting structure for file names.

Four-digit year

You do this so as not to confuse a year with a month. If you have a date written as 08-07-08, is that August 7, 2008 or 8 July, 2008? You can’t tell.

"That doesn’t matter, I always use month/day/year."

It does matter because not everybody uses month/day/year.

Two digit month or single digit month with leading zero

A two digit month is each enough to understand. For example, December is 12.

A single digit month, like May, is 5. But you don’t write it like that. You add in a leading zero so it’s written as 05.

Why?

Because some operating systems will not list files in proper numeric order without the leading zero. Windows XP and all previous versions prior to it do this.

Example: You have 10 DOC files from 0 to 10. The single digits have no leading zeroes on them.

This will show in XP in Windows Explorer as:

0.doc
1.doc
10.doc
2.doc
3.doc
4.doc
5.doc
6.doc
7.doc
8.doc
9.doc

Note the 1 and the 10 are right on top of each other. Why does XP do this? Because 1 comes after 0, before 2 and all other numbers. XP is only going by the first character it "sees."

Even Windows Vista and 7 still do this when listing files outside the Windows Explorer interface (such as a File/Open dialog box.)

Second example: 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10

All these numbers will be listed in proper order. 0 always comes before 1, and even with the way Windows lists files, it absolutely will not get this "wrong"; that’s why you do it.

Two digit day of month or single digit day of month with leading zero

You do this for the exact same reason as for the month.

Underscore

The underscore (this character: _) is necessary because the dates uses dashes already. Using underscores gives a clean visual cue as to what’s a descriptor and what’s a date.

In addition, you use underscores because trying to send a file over the internet with a literal space in it results in a %20, or just fails on attempt to transfer. A replacement must be used for the space to avoid this. Underscore is it.

Description of file in lowercase letters with words separated by underscores

As said above, this is optional. You use lowercase just in case you ever have to upload this from a command line via FTP. Where case of letters is involved, mistakes can be made easily – especially if it’s a long file title. If you know all the letters are lowercase, this decreases typing mistakes significantly.

Why Year/Month/Day and not Year/Day/Month?

Year/Month/Day is proper big endian formatting and follows ISO 8601 international standard. Year/Day/Month does not. You can see more info here on that if you like.

Okay, so I know a bunch of stuff about date formatting in files now. Why should I care?

You should care for three good reasons.

First and most obvious, it will make your files easier to manage no matter what OS you use. And if you plan on sticking with XP for a while longer, this is mandatory because of the way it lists files starting with digits.

Second, being that the world is getting smaller every day, chances are you’ll be trading files with someone across the pond sooner or later, if not doing so already. Using the internationally recognized big endian standard eliminates any and all confusion as to what a date format truly represents.

Third, in addition to files being sorted properly no matter the OS you use, they will also sort properly no matter what web site you use. Using Windows SkyDrive, Google Docs, plain FTP or other means of online storage? You’ll be able to sort a whole lot easier using proper date formatting in the titles of your files.

Wouldn’t it be easier just to sort by date modified or date created?

Not necessarily because it can add in many repetitive steps.

In Windows (XP/Vista/7,) two columns that can be added via Windows Explorer are Date Modified and Date Created. However in order to see these, you have to be in Details view mode when looking at files.

Date Modified is usually there by default, but Date Created isn’t, so you have to add that in by right-clicking a column to see all that are available, then choose Date Created so it can be seen.

Example from Windows XP:

image

To get to this point, it took five clicks just to see this stuff.

  1. View
  2. Details
  3. Right-click column
  4. Date Created
  5. Click to sort by date created

You may have to do this over and over again – particularly in XP – because this view mode may not be "remembered" by Windows. It can get very frustrating quickly.

Adding in the date to the title of the file eliminates the need to do any of this.

Where would using date formatting like this in file titles be most useful?

Three instances comes to mind:

  1. Photos
  2. Documents
  3. Dated audio or video broadcasts

Is there ANY WAY to automate the process of renaming multiple files with the date like this?

Absolutely. The tool you need is Rename Master for Windows. Here’s how to use that software to modify as many files as you want – all at once – with their creation date at the front:

1. Launch Rename Master.

2. Remove all existing steps. This is done easily by clicking Edit then Clear Renaming Options, like this:

image 

3. In RM, navigate to the folder where the files are. Do this by using the Folder Browser on the left of the application. If you don’t see it, press CTRL+B while using Rename Master.

4. Click the New Step button, then Add to Beginning/Ending, like this:

image

5. Add the following in: ?dc:FYYYY-MM-DD?_

Yes, I know that looks weird, but it works. It looks like this:

image

Make sure to select "at the Beginning" and "to the Name" as shown above.

6. Click the New Step button again and choose to Replace Name/Phrase, like this:

image

7. Set the step to look like this, and follow the steps carefully:

image 

Next to "Replace the" we select phrase. This will enable the other fields.

In the field directly to the right of phrase, click inside and press the spacebar once to add in a space. You cannot see this in the screen shot above because a space obviously cannot be seen.

In the field directly to the right of with, type in an underscore (this character: _).

8. Click the Case & Wildcards tab, check Override configuration settings and tick the option for lowercase, like this:

image

9. Compare the Name to the New Name column to make sure the appropriate changes will be made.

image

Above is exactly what we want. The best example is "New OpenDocument Text.odt."

As you can see from the New Name column, it will be changed to:

2009-09-23_new_opendocument_text.odt

The file creation date is added using the proper date formatting. All spaces are replaced with underscores and letters that were capitalized are changed to lowercase.

After that it’s a click of this button:

image

(Located at the bottom of Rename Master)

..and that’s all there is to it.

Always remember to proceed carefully with the renaming of files, especially for large amounts of them. Pay close attention to the New Name column in Rename Master when using the software, because whatever you see there is exactly what the files will be renamed to verbatim. So if it looks wrong, it is wrong. Correct it before hitting that rename button at the bottom.

Final notes for Vista/7 users

As you know, file permissions are needed in order to rename files in specific places. RM may not function correctly if you try to modify files it doesn’t have proper access to. To overcome this, rename files that you have located either in a specific folder you create on the desktop or a specific folder you create in My Documents. RM should work without issue when renaming files from those locations. Just remember to create a specific folder to do it so you don’t rename anything else by mistake.