vEdit makes it easy to ensure that all lines in a text file have the same length. For example, if each text line is one data record and the file will be imported into a database, all lines may need to be the same length.

The function EDIT > Convert > All lines same length forces all text lines to have the same length; it prompts for the desired length. Lines shorter than the desired length are padded at their end with spaces; lines longer than the desired length are optionally truncated.

Pad Lines To Same Length.png

Force All Lines to the Same Length

  1. Select Edit , Convert then All lines same length
  2. Enter the desired length for all lines
    • Or, click Scan to determine the length of the longest line in the current file. This length is then used as the desired length.
  3. Click Pad. Every line in the file, which is shorter than the desired length, will have spaces added at the end of the line to equal the desired length.

If any lines are already longer than the desired length, you are prompted with: Ignore, Truncate, or Stop.

It is recommended to stop and correct this inconsistency.

Alternatively, you can truncate the too-long lines. If you ignore the long lines, not all lines will have the same length.

See Also:

Find Longest Line
Use User > Find longest line to find the longest line in a file.
Check Lines Same Length
Use User > Check lines same length at any time to check if all lines in file have the same length.
Insert Empty Columns
Use Block > Insert empty columns to insert a field of empty columns in the middle of a group of lines.

Related Resources