(Created page with "<seo title="Strip Trailing Spaces from a File | vEdit" description="Learn how easy it is with vEdit to strip trailing spaces from a file for converting or just cleaning up fi...") |
|||
| Line 8: | Line 8: | ||
*The function <kbd>EDIT</kbd> > <kbd> > <kbd>Convert</kbd> > <kbd>All lines same length</kbd> adds trailing spaces to make all lines the same length. | *The function <kbd>EDIT</kbd> > <kbd> > <kbd>Convert</kbd> > <kbd>All lines same length</kbd> adds trailing spaces to make all lines the same length. | ||
*Files exported from databases often have trailing spaces, perhaps corresponding to unused fields. | *Files exported from databases often have trailing spaces, perhaps corresponding to unused fields. | ||
| + | |||
| + | ---- | ||
| + | |||
| + | While trailing spaces generally don't cause problems, sometimes they do, especially if some lines have many trailing spaces. For example, a line with many trailing spaces may print as two lines, with a blank second line. This can be very confusing. | ||
| + | |||
| + | There are several ways to see if a file has trailing spaces. | ||
| + | |||
| + | ;Find Trailing Spaces | ||
| + | :Go to the beginning of the file and select <kbd>USER</kbd> > <kbd>Find trailing spaces</kbd> . It moves the cursor to the first trailing spaces (or tab characters), if any. | ||
| + | ;Highlight Cursor Line | ||
| + | :Set <kbd>CONFIG</kbd> > <kbd>Display options</kbd> > <kbd>Highlight cursor line</kbd> to “2”. This setting highlights only actual characters on the current line, including trailing spaces. Any trailing spaces on the current line will therefore stand out. | ||
| + | ;Window Erase | ||
| + | :Set <kbd>CONFIG</kbd> > <kbd>Editing colors</kbd> > <kbd>Window erase</kbd> to a non-zero valuewhich is different from “Edited text”. This gives an unusual (and a bitstrange) effect in which the actual text characters are in one color and and the space past the end of each line is in a different color. Its only purpose is to make trailing spaces stand out. | ||
| + | ;Show Newlines (CR/LF) | ||
| + | :Enable <kbd>VIEW</kbd> > <kbd>Options</kbd> > <kbd>Show newlines (CR/LF)</kbd>. This lets you see where each line ends; it helps show any trailing spaces. | ||
| + | |||
| + | Assuming you have the default <kbd>USER</kbd> menu loaded, it is easy to remove trailing spaces. | ||
A common operation when converting files, or just cleaning up files, is to remove trailing spaces. (Trailing spaces are “extra” spaces past the ends of lines.) Trailing spaces can come from several sources:
While trailing spaces generally don't cause problems, sometimes they do, especially if some lines have many trailing spaces. For example, a line with many trailing spaces may print as two lines, with a blank second line. This can be very confusing.
There are several ways to see if a file has trailing spaces.
Assuming you have the default USER menu loaded, it is easy to remove trailing spaces.