Write a program to copy the odd rows from sheet1 of file1.xls to sheet1 of file2.xls

Showing Answers 1 - 5 of 5 Answers

narasing

  • Oct 10th, 2006
 

sheet1 = "file1.xls";

sheet2 = "file2.xls";

rc1 = ddt_open(sheet1, DDT_MODE_READWRITE);

rc2 = ddt_open(sheet2, DDT_MODE_READWRITE);

if (rc1!= E_OK && rc1!= E_FILE_OPEN)

                   pause("Cannot open table?");

ddt_get_row_count(sheet1,n);

for(i = 1; i<= n; i ++)

{

                   ddt_set_row(sheet1,i);

                   a = ddt_val(sheet1,"inputa");

                   if (i mod 2 != 0)

                    ddt_set_val(sheet2,"result",a);

}

ddt_save(sheet1);

ddt_save(sheet2);

ddt_close(sheet1);

ddt_close(sheet2);

 

  Was this answer useful?  Yes

bobby

  • Nov 6th, 2006
 

 Excellent Code Narasing....Really good One

  Was this answer useful?  Yes

naveen

  • Dec 12th, 2006
 

good work narsing

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions