|
table = "C:\\lesson8.xls";
Result="c:\\result.txt";
table2 = "C:\\lesson9.xls";
file_open(Result,2);
rc = ddt_open(table, DDT_MODE_READ); //open XSL File
ddt_open(table2,DDT_MODE_READWRITE);//open XSL File
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table.");
ddt_get_row_count(table,table_RowCount);
for(table_Row = 1; table_Row <= table_RowCount; table_Row ++)
{
# ddt_set_row(table,table_Row);
# aa=ddt_val(table,"CUS"); #get data from XLS file
aa=ddt_val_by_row ( table, table_Row, "CUS" ); #get data from XLS file by row
file_printf(Result,"%s ",aa,"\n"); #write data in txt file
# ddt_set_val(table2,"CUS",aa); #write data in XLS file
ddt_set_val_by_row ( table2, table_Row, "CUS", aa ); #write data in XLS file by row
}
file_close(Result);
ddt_close(table);
ddt_save(table2);
ddt_close(table2);
个人在V8。1上面都能跑过的,大家分享一下!有什么好方法也交流一下,谢谢各位了。
[ 本帖最后由 peter.zheng 于 2008-8-14 10:47 编辑 ] |
|