Text Editors—Not Just for Coders—the Secret Weapon for Text Management
February 11, 2019
February 11, 2019
Other than geeks, few people use text editors. Many don’t even know what they are.
So what are they? Text editors are powerful tools for—you guessed it—editing text!
And since just about everyone edits text on the computer, almost everyone can put one to good use.
Here at IVANNOVATION we translate and manage millions of words every year. That means that text editors have become a critical tool in our translation project management toolbox.
There are a number of text editors to choose from. This Wikipedia page lists 74.
But EmEditor is the tool we’ve been using at IVANNOVATION for almost two decades. We’ve found that it covers our text manipulation needs (unlike some some simpler text editors like Windows Notepad).
Here we’ve listed some of the reasons we love to use text editors, specifically EmEditor, for our work, starting with some more technical reasons and finishing with some simple reasons that even your non-techy grandparents could appreciate.
- Open Huge Files
- Perform Advanced Find and Replace
- Edit Multiple Files Without Opening Them
- Compare Files with a Text Editor
- Edit Multiple Lines at Once
- Use Macros
- Open Files with Any Character Encoding
- Visually Distinguish Elements in File
- Use a Lightweight Program for Writing
- Strip Formatting
Open Huge Files
We translate tens of millions of words every year, so massive text files frequently pass through our hands.
With most tools we might have to sit for hours waiting for the computer to open large text files. But not with EmEditor.
Yuri Ivanov, founder of IVANNOVATION and a regular user of text editors for translation management said, “EmEditor is fantastic at opening huge files. Even files that are half a gigabyte it can open and run procedures on.”
Actually, according to Wikipedia, “half a gigabyte” doesn’t even scratch the surface; EmEditor can open files of up to 248 GB, or 2.1 billion lines.
Rather than opening the whole file in memory, like some other programs do, it calls disk space in to play to reduce the memory load. For files larger than 248 GB, it can separate the file into manageable sections and open them separately.
Various text editors can open different sized files, but EmEditor in particular is notable for its ability to open massive files.
Perform Advanced Find and Replace
This is one of the key functions for which we use text editors. Sometimes we need to find forbidden terms in a file. With the find function, we can easily locate all of them. With the replace function, we can easily change them.
But we don’t merely search for words with the tool, we can also search the files with regular expressions. A regular expression, or regex for short, is a system of symbols that represent some kind of a pattern in a text.
It might sound hard, but after a little playing around, you can make it work for you.
Here’s an example of using regular expressions to find something with EmEditor. Imagine someone created a document with some prices listed out, but he or she made some mistakes and added a space between the dollar sign and the number on a few of them. How can we quickly find the prices with that mistake and ignore everything else?
Search with “[$]\s\d”.
How does it work? Putting any character between square brackets in the search bar tells it to look for that character. Putting “\s” makes it search for any white space. Putting “\d” tells it to look for any digit.
So in short, “[$]\s\d” searches for a dollar sign, then a space, and then a number.
Find and replace with regular expressions in a good text editor gives you superpowers to quickly make changes across huge documents.
Edit Multiple Files Without Opening Them
EmEditor allows users to run find and replace in multiple files simultaneously without even opening them.
Ivanov said that once he exported text from an Oracle database. In the exported files no matter how many words were in the line, every line was 5,000 characters long. That means that if the text in the line was only 10 characters long, it would be followed by 4,990 white spaces.
“So these files were absolutely huge,” he said. “And most of it was wasted space . . . spaces that is.”
But by taking some regex from the EmEditor’s regex example page, “\s+?$”, he was able to quickly search 50 files, removing all of the white spaces. In only a few clicks he changed the file size from megabytes to kilobytes.
Another time we had a massive software localization project with about 1,000 directories and 10,000 files, and we needed to change a tag in front of a certain user interface option. With a quick “Search > Replace in Files,” we completed the task in moments.
Compare Files with a Text Editor
Have you ever had two files on your desktop that have the same or a similar name and you aren’t sure if they are the same or different?
With EmEditor, finding differences is a snap.
In the following image we had two TMX (translation memory) files, and we wanted to be sure to keep the correct one. It could take hours to scan them both carefully for differences, so we used the compare function in EmEditor.
No more worrying about which file we should keep.
Edit Multiple Lines at Once
With a word processor like Microsoft Word, you can edit only one part of the document at a time. However with many text editors you can edit multiple places at once.
In EmEditor make a selection, hit the Ctrl key, and then make another selection. Do it until you find all the places you want to edit. Then just type in or delete whatever you want.
Want to select other items that are the same as the current item? Select the item and keep hitting Ctrl + R until you have selected all of the instances you want.
In the below image, I happened to notice that someone once again put spaces in wrong places. I put my cursor in everywhere I want to delete, and then boom! Deleted.
Sometimes we all have to do repetitive tasks that follow a certain sequence. This is where macros come in to save your day.
With a macro you can hit the record button, do the steps, hit the stop button, and then save the macro with a shortcut key. From then on, whenever you want to perform those steps again, you can simply hit the shortcut key, and it’s done!
Let’s use a macro in EmEditor to quickly fix all of the errors from our dollar-signs-and-numbers example above. Hit “Macros > Start/Stop Record,” search for the first instance of the error, move the cursor, delete the extra space, and then stop recording. Next, go to “Macros > Run with Temporary Options…,” tell it how many times you want it to run the macro and check the “Stop if Search Fails” box, then click OK. Finally, watch the magic happen.
A task that would take you minutes or hours, will take EmEditor seconds.
Open Files with Any Character Encoding
This was the original reason we purchased EmEditor so many years ago. Encoding is how the computer changes 1s and 0s into letters and numbers that we can read.
Nowadays, the encoding UTF-8 is pretty much the standard for supporting all languages. But especially in the old days, the computersphere was a mess of competing encoding systems for various languages.
A file with the wrong encoding would display foreign language characters with question marks or other strange characters instead of the correct character.
It was during these bad old days of encoding mayhem that EmEditor came to the rescue to allow us to open pretty much any file regardless of the encoding.
This can be a bit of a hairy topic, but the simplest explanation of the topic I’ve seen can be found at Text-Editor.org.
Visually Distinguish Elements in File
EmEditor, like many text editors, has a feature called syntax highlighting that can highlight different kinds of text in different colors.
Since we localize a lot of software, we frequently deal with files that contain both text and code. Using syntax highlighting it’s easy to distinguish between the two.
The following image is an HTML file. You can see that the text is black. The brackets are blue. The element names are purple. The attribute names are orange. And the attribute value is pink.
Regardless of whether you are concerned with the text or the tags, it’s easy to visually distinguish them instantly by color.
Use a Simple, Lightweight Program for Text
Most people use Microsoft Word to write text, but for speed in opening documents and simplicity in the composition process, nothing can beat a text editor.
I actually never compose our articles in word processors like Microsoft Office, LibreOffice, or Google Docs. I’m composing this article as a TXT file right here in EmEditor because it’s lightweight and simple.
First, EmEditor (like many other text editors) is extremely lightweight. It opens up with lightning speed. A word processor on my computer took 16.49 seconds to open this article draft whereas EmEditor took 1.12 seconds.
I can just hit Windows Key, type “em”, hit return, and EmEditor opens almost instantly.
Second, a text editor is simple. Whereas the typical office program has endless formatting options to distract you and slow you down as you write, the text editor has only text. That’s all.
Given this simplicity, we stick composing articles as TXT files in a text editor. Anything else is a complication.
Finally, the simple reason we pretty much always have a text editor open on our computers: it strips formatting from text.
An email that has various sections in different fonts and line spacings was obviously created by copying and pasting text from documents with different formats. It looks messy and maybe even insincere.
Everyone copies and pastes sections of text into emails to save time, but still nobody wants to give readers the impression that he or she cobbled together the email.
By pasting the text into a text editor, hitting Ctrl + A, and hitting Ctrl + X, we can be sure to have text that has absolutely no formatting information with it.
These are only a few of the functions for which we use EmEditor every day. Some of the functions are for very special situations, but other functions we use every day.
Most people think of text editors as tools for only hackers and coders. But the fact is that they have amazing functions that everyone can use.
Darren Jansen, business development and content manager for IVANNOVATION, has a lifetime love for tech and languages. At IVANNOVATION he helps software developers get professional localization for their apps, software, and websites. On his time away from the office, he can be found hiking the Carolina wilderness or reading Chinese literature.