Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rename fields name
Message
From
06/09/2006 07:12:48
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
06/09/2006 05:42:59
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01151225
Message ID:
01151248
Views:
18
I think there are several options, for example:
  • After importing the Excel sheet, you might use ALTER TABLE to change the field names.
  • If I remember correctly, APPEND FROM ... TYPE XLS will replace the fields in the order they appear in the XLS and DBF files (first field to first field, etc.). If the table structure doesn't conform, you can do this to a temporary table first.
  • Excel Automation gives you much greater control, but it is slow if you have a large Excel sheet (and manipulate each cell individually).
  • You could also use Excel Automation to save the Excel sheet to a DBF.

    >hi all,
    >
    >any help to rename fields name as,
    >
    >i have excel sheet with field names as
    >telno,customer_name,customer_number
    >,area,resiential
    >
    >i need to append all data form myexcel sheet to my table alldata
    >
    >CLOSE all
    >CREATE TABLE alldata( num n(9) ,service_type n(2),area n(2),Tel C(10) nocp,account_num c(15) nocp, customer_name C(80) nocp,flag n(2),n_try n(8))
    >***APPEND FROM d:\yosef\alldat TYPE xl5  &&it works take it as it is
    >
    >**i need to replace field name and data as
    >append blank
    >replace tel with telno
    >replace area with area
    >replace customer_name with customer_name
    >replace account_num with customer_number
    >replace num with 0
    >replace flag with 0
    >replace n_try with 0
    >
    >thanks
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform