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
Click the "Search" menu and choose "Replace." Alternatively, you can click the "Replace" button on the tool bar.
Video of the Day
Click within the input box labeled "Find what" and then press your space bar once. Leave the "Replace with" input box empty.
Select the "Active document" radio button so that TextPad removes the space characters in the current document only.
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.
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."
Select the "Text" and "Active document" radio buttons.
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.
Click "Replace All" to remove all tabs from your text document.
Remove Empty Lines
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.
Check the box labeled "Regular expressions." TextPad will scan your entire document for the newline code.
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.