(Related Resources)
Line 42: Line 42:
  
 
==Related Resources==
 
==Related Resources==
*[[USB_Installation|USB Flash Drive Installation]]
+
*[[Convert_Windows_Mac_Linux|Convert Between Windows, Mac and Linux File Types]]
 +
*[[Convert_Windows_Mac_Linux#Confirm_File_Type|Confirm File Type]]
 
*[[Main_Page| Wiki Home Page]]
 
*[[Main_Page| Wiki Home Page]]

Revision as of 19:02, 28 January 2017


vEdit makes converting text, database, and binary files with fixed-length records properly easy. Files with “fixed-length records” fall into two categories:

  • Data/binary files that are organized into records of the same length. There is no “Newline” (e.g., Carriage-Return and Line-Feed) at the end of each record. Therefore, you must explicitly set the correct record length with CONFIG > File handling > File type. When properly set, the records will align nicely within vEdit. You will have to “know” the record length from the file specifications, or you will have to deduce it. Such files are edited in “Record” mode.
  • Text files in which all lines have the same length. Each line (record) ends with a “Newline” (e.g., Carriage-Return and Line-Feed). Such files are already normal text files.

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:

  • If the records are aligned when you first open it, it is probably a text file. CONFIG > File handling > File type will be set to “0”, “1” or “2”.
  • If nothing is aligned when you first open it, it is probably a data/binary file. VEDIT typically opens binary files with a record length of 64; you must set CONFIG > File handling > File type to the correct record length and possibly CONFIG > File handling > Record header size to the correct header size. The records should then be aligned on the screen.

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.

Converting from Fixed-Length to Normal Text

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.

Convert from fixed-length records into normal text file

  1. Check if the file’s record length is set correctly; the records should be nicely aligned on the screen. If necessary, use CONFIG > File handling > File type to set the correct record length.
  2. Next make sure e records don’t already end in Carriage-Return and Line-Feed. To check this, place the cursor at the end of one record and then press Alt-D (hot-key for VIEW > Toggle display mode) six times to toggle into “Hex mode”. If there are hex codes “0D” and/or “0A” then the records already end in Carriage-Return and/or Line-Feed (skip step 3). If not continue on to step 3 after Press Alt-D four more times to toggle back into the normal “ASCII-0” display mode.
  3. Select EDIT > Convert > CONVERT macro. Select Yes to convert the entire file.
  4. In the convert menu, enter “7” to convert from fixed-length records to “newlines”. Then select [Win/DOS] assuming you want Carriage-Return and Line-Feed at the end of each record.

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.

Related Resources