How Can I Remove Spacing in TextPad?

By Allen Bethea

The most basic way to get rid of extraneous spaces from text documents is to scan for them line by line and remove each one with your Delete key, but this can become quite tedious work. If you are using a text editor like TextPad, however, you can remove unneeded spacing instantly using the application's built-in Replace tool. The Replace tool can also remove all blank or empty lines from your document.

Remove Space Character

Step 1

Click the "Search" menu and choose "Replace." Alternatively, you can click the "Replace" button on the tool bar.

Step 2

Click within the input box labeled "Find what" and then press your space bar once. Leave the "Replace with" input box empty.

Step 3

Select the "Active document" radio button so that TextPad removes the space characters in the current document only.

Step 4

Click "Replace All" to command TextPad to search for each space character in your document and remove it without putting anything else in its place. Each line of your document should be condensed and free of empty spaces.

Remove Tabs

Step 1

Type "\t" in the "Find what" input box. TextPad and Windows interpret "\t" internally as the code signaling a tab indention, rather than the literal character string “\t.”

Step 2

Select the "Text" and "Active document" radio buttons.

Step 3

Check the box labeled "Regular expressions." When "Regular expressions" is selected, TextPad will scour through your document for the internal codes rather than literal characters. When it finds the internal code for "\t", it will delete the preset number of spaces that each tab represents.

Step 4

Click "Replace All" to remove all tabs from your text document.

Remove Empty Lines

Step 1

Type "\n" in the "Find what" input box. The "\n" characters internally signals the end of the current text line and the beginning of the next line in your document. The "\n" character sequence is also known as the "newline" or "end-of-line" code.

Step 2

Check the box labeled "Regular expressions." TextPad will scan your entire document for the newline code.

Step 3

Click "Replace All" to remove all blank lines from your document. All the text in your document will then be displayed as a single line.

Tips & Warnings

  • Save even more time by creating a TextPad macro to sequentially remove all single spaces and tabs in your documents with a single command. Open a document containing spaces and tabs. Click the "Macro" menu and then "Record." First, go through the steps necessary to remove spaces and then the steps to remove tabs. Press the "Record On/Off" button to stop the macro from recording. Click "Yes" to save the macro, fill in the "Save Macro" dialog box information and then click "OK." To run this tool on another document, click "Macro" and then the name of the macro you created.
  • Information in this article applies to TextPad 7.4. It may vary slightly or significantly with other versions of TextPad.