Templates

ID #1045

How to convert data file to new structure?

If a file's definition needs to be changed and meaningful data exists, follow these steps to convert the file. This method creates an executable file that you can ship to end users to convert their data files. If you want to convert a file without creating a file conversion program see How to Convert a File (without generating source).
  1. Open the dictionary that contains the file to be modified.
  2. Copy the data file definition to a new name. To copy a file definition, highlight the file to be copied in fhe Files List and press CTRL+C, then press CTRL+V to paste it. You will be prompted to supply a new name and prefix. (Example - copy Customer to OldCustomer)

An alternative would be to copy the entire dictionary to a new name. You might use this method if there are multiple files to be converted in one session. Clarion allows files to be converted from one dictionary to another.

  1. After the file definition has been copied, make any necessary changes (add fields, change the file driver type, etc.) to the definition with the original name. In our example above, the Customer file is the file to be modified.
  2. Save the Dictionary after file modification and close it.

The Dictionary file must be closed in order to use it for file conversion.

  1. Load the file in the Database Manager File utility (File » Open, Database Tab)
  2. Navigate to the file to convert, then select it. You are prompted to specify a file driver
  3. Select the file's driver from the drop-down list. The Database Manager opens the file and displays it's contents.
  4. Choose File » Convert File (or press CTRL+V).

The File Convert dialog appears, prompting for the information below:

  1. In the Target Filename field, specify the name of the new file. This defaults to the current file name Specify a different name if you have not backed up your data file.
  2. In the Target Dictionary field, specify the dictionary which contains the file definition to which to convert.
  3. In the Target Structure field, specify the structure within the target dictionary which defines the target file.
  4. In the Generated Source field, specify the file name for the generated source code or accept the default of CONVERT.CLW.

Tags: data file conversion

Related entries:

Last update: 2007-07-13 16:04
Author: SoftVelocity
Revision: 1.0

Digg it! Print this record Send to a friend Show this as PDF file
Propose a translation for Propose a translation for
Please rate this entry:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You can comment on this entry