An Easy Way To Read .txt Files

Text documents with the extension .txt are often found in folders downloaded from drupal.org, such as modules, themes, and project releases.

As an example, lets look at the folder for Drupal 5.1.

It contains a file called install.txt which, logically, I might want to read before installing. However, when I open the file by double-clicking on it, I just get a pretty illegible chunk of text.

All of the words are there, but everything is lumped together with no formatting, and there seem to be little rectangular boxes all over the place. So what do I do?

Well, I could just trawl through the file and make the best of it, but there is a far better solution - open it using Word.

There are two ways you can do this. If you already have the .txt file open just do the following:

  • select all of the text by right-clicking and then choosing 'Select all'
  • right-click again and choose 'Copy'
  • now open up Word for Windows and create a new file
  • richt-click on the new file and choose 'Paste'
  • that's it!

If the file isn't open just:

  • right-click on it
  • go down to 'Open With...' and choose Microsoft Word
  • if Word asks you what conversion you'd like to use just stick with the Windows default
  • that's it!

All of the text is now easily readable, and you've got no more need to try and decipher those crazy .txt files.

P.S. - For those who are interested, the little rectangular boxes that were all over the place in the .txt file determine the line breaks. One box means the line just breaks, two boxes means the line breaks and then leaves a gap, and so on.

5 comments

1
royMay 25th 2007 @ 08:08PM

But what program is it that the text files open in when you doubleclick them?
Word hardly seems like a light-weight option for reading plain text files…

Your drupaltheming posts are interesting, rock on!

2
KarenMay 26th 2007 @ 12:51AM

I highly recommend the Notepad replacement program found at NoteTab.com. It will display the text files in a readable fashion and has other nice features. There is a free version available, and a pro version with syntax highlighting. I have never regretted the purchase.

I am also enjoying your theming series.

3
LaurenceMay 26th 2007 @ 12:32PM

- Hi Roy, by default when you doubleclick a .txt file in Windows it will open using Notepad. However, Notepad removes all of the formatting (line breaks etc.) so you are left trying to read a big lump of text. By opening the file using Word instead of Notepad the formatting is implemented and the file is much easier to read :)

- Hi Karen, nice suggestion - I'll have to check that out. I guess you might well be able to use NoteTab on both Windows and Mac, which would be handy.

4
MichelleJune 18th 2007 @ 08:25PM

I believe the problem is trying to read *nix style line endings in Window's notepad. Pretty much anything out there besides notepad will read them correctly. I like notepad2 and it comes with instructions to have it replace notepad on your system so you're back to just double clicking the file.

Michelle

5
Sean HodgeJuly 3rd 2007 @ 12:01AM

It looks fine on a mac. Opens in textEdit fine.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options