vEdit makes converting text, database, and binary files with fixed-length records properly easy. Files with “fixed-length records” fall into two categories:
A file “exported” from a database will often be a text file in which all lines (records) have the same length. However, the raw database file will often be a binary file with fixed-length records.
Once you open the files it should be easy to figure out which you have:
Text files, in which all lines have the same length, generally do not need to be converted into anything else.
Files with fixed-length records are limited in how you can edit. For example, you can not insert or delete characters since this would change the length of the current record and thereby corrupt the entire file. Similarly, you cannot delete a field by highlighting it as a columnar block.
This limitation on editing files with fixed-length records is controlled with CONFIG > File handling > Overwrite-only mode. You can turn it off, but you must then be extra careful not to corrupt the file.
When possible, you should convert the data file into a standard text file with Carriage-Return and Line-Feed after each record. This is easily done in vEdit.
Data files with fixed-length records can be converted into normal text files which have a “Newline” (e.g., Carriage-Return and Line-Feed) at the end of each record. In other words, each record is converted into a text line. Such text files are much easier to edit and can be imported into databases and other programs.
Although the file will not look any differently on the screen now, it will have been converted. You can confirm this by checking CONFIG > File handling > File type; it should now be set to “0”.
After saving the converted file, you should be able to open/import it in most other programs.
Text files with "Newline" characters can be converted into data files with fixed-length records and without "newline" charaters.
This procedure generally only done if all text lines have the same length. In particular, the longest text line should not be longer than the desired record length. The conversion will pad shorter lines and can optionally truncate longer lines.
1. Select User then Find longest line. If the longest line is longer than the desired record length it is recommend to stop and correct the length. Alternatively, you can have lines longer than the record length truncated in the following steps.
2. Select Edit, Convert, then Convert Macro. Select Yes to convert the entire files.
3. In the convert menu enter "8" to convert to a data file with fixed-length records.
4. Enter the desired record length, you maybe prompted for confirmation to convert any tab characters into spaces (based on the currently configured tab stops).
5. If any lines are longer than the record length you will be prompted with: Split, Split All, Truncate, Truncate All, Edit, or Abort.
Any lines shorter than the record length are padded with spaces to the record lenght.
6. If any lines are split or truncated, the files convert.err display a summary of the conversion, including the line numbers of the too-long lines.
You can confirm your changes by clicking Config > File handling > File type; it should now be set to the selected record length.