Share via


Selecting Records to Append

If you only want to append certain records, you can use a FOR expression. Visual FoxPro uses the expression to search the entire file and append only records that match the expression you provide. The fields you specify in the FOR expression must exist in both the source and destination files.

To select records to append

  1. Browse the destination table, and then from the Table menu, choose Append Records.

  2. Enter the source file type and name, and then choose Options.

  3. Choose For to build an expression in the Expression Builder dialog box.

    Note   You do not need to enter the command FOR because it is implied. For example, type customer.country = "Canada" to append only Canadian information.

  4. Choose OK.

Appending Text Files

If you append from a text file, Visual FoxPro assumes your fields are separated by commas and that each character field is enclosed by quotation marks. If you have set the decimal point character to display as a comma, numeric and currency data might be parsed into separate fields.

Appending Numeric or Currency Text

If you changed the Visual FoxPro decimal point character to a comma, numeric and currency data might be parsed into separate fields when you append or export the data. For example, Visual FoxPro would translate the value 100,00 into two fields because it appears to be delimited with a comma. Choose one of two methods to make sure the comma is properly translated:

  • Use tabs to separate fields in the text file
  • Change the decimal point character back to a period

If you want to append from a text file, change the field separators to tabs, then use the APPEND FROM command with the keywords DELIMITED WITH TAB.

If you want to change the decimal point character to a period before appending text files, you can change the character back to a comma after you append the file.

To change the decimal point character

  1. In the Command window, type the following command.

    SET POINT TO
    
  2. Import the file using the DELIMITED keyword.

  3. In the Command window, type the following command to reset the decimal point character to a comma.

    SET POINT TO ','
    

See Also

Selecting Fields to Append | Process of Exporting Data | Importing and Exporting Data | Appending Data to an Existing Table | Appending Data with the Import Wizard | Process of Appending Data