I have given dataset with some viables because all the variables are not possible with dataex command and I have created tables using the given command.I have used table command because i need tables in this format. now i want these tables in excel. i can not just copy and paste to excel because there are lots of tables. so please help me out to do this.
///DIST
table WORK_TYPE YEAR, contents(mean DIST ) by(MIGRANT) format(%9.2f)
table WORK_TYPE YEAR, contents(mean DIST ) by(GENDER) format(%9.2f)
table WORK_TYPE YEAR, contents(mean DIST ) by(RELIGION) format(%9.2f)
table WORK_TYPE YEAR, contents(mean DIST ) by(CASTE_GROUP) format(%9.2f)
table WORK_TYPE YEAR, contents(mean DIST ) by(STATE) format(%9.2f)
table WORK_TYPE YEAR, contents(mean DIST ) by(DISTRICT) format(%9.2f)
table WORK_TYPE YEAR, contents(mean DIST ) by(VILLAGE) format(%9.2f)
table WORK_TYPE YEAR, contents(mean DIST ) by(EDU_LEVEL) format(%9.2f)
table WORK_TYPE YEAR, contents(mean DIST ) by(MARI_STAT) format(%9.2f)
table WORK_TYPE YEAR, contents(mean DIST ) by(REL) format(%9.2f)
table WORK_TYPE YEAR, contents(mean DIST ) by(WORK_PLACE) format(%9.2f)
table WORK_TYPE YEAR, contents(mean DIST ) by(CO_NF_WORK) format(%9.2f)
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long HH_ID int YEAR byte(WORK_TYPE CO_NF_WORK WORK_PLACE) str24 WORK_PLACE_OT str1 MIGRANT double(DIST WORK_DAYS AVG_WORK_HRS WAGES_CASH WAGES_KIND) byte INV_UNEMP_DAYS double(OWN_FARM OWN_DOME OWN_LST OWN_OT) byte SERI_ILL
638 2010 1  . 1 "                        " "N"   0 16   6     . 1330  .  2 31  6 . .
142 2010 1  . 1 "                        " "N"   0 20   8  1400  100  .  2 15  . . .
461 2010 2 19 1 "                        " "N"   0 30   3  6000    .  .  . 15  . . .
499 2010 2 20 5 "                        " "N"  18 24   7  8500    .  1  .  3  . . .
132 2010 1  . 1 "                        " "N"   0 22   8  1540  120  .  . 15  . . .
488 2010 2 25 4 "                        " "Y" 170 26   8  5200    .  .  .  .  . . .
177 2010 2 23 1 "                        " "N"   0 24   9  8000    .  .  .  2  . . .
 28 2010 2 25 1 "                        " "N"   0 30   2   300    .  .  .  8  3 . .
617 2010 1  . 1 "                        " "N"   0 27   7  1900    .  .  2  .  . . .
655 2010 2 20 1 "                        " "N"   0 17   6  2250    .  5  . 12 17 . .
473 2010 1  . 1 "                        " "N"   0 12   8  1200    .  . 14 15 12 . .
495 2010 1  . 1 "                        " "N"   0 15   8   900    .  2  . 12  . . 1
641 2010 1  . 1 "                        " "N"   0 25   6  1350    .  .  2 30  4 . .
658 2010 2 19 1 "                        " "N"   0 27 2.5  2100    .  .  8  .  . . .
132 2010 1  . 1 "                        " "N"   0  9   8   900   70  .  .  .  . . .
759 2010 2 25 1 "                        " "N"   0 22   1 12000    .  .  8  4  . . .
  3 2010 2 12 1 "                        " "N"   0 31   6  4500    .  .  .  2  7 . .
244 2010 2  1 2 "                        " "N"  10  .   . 14800    .  .  4  3  2 2 .
190 2010 2 20 1 "                        " "N"   0  3  10   900    .  .  2  .  . . .
212 2010 1  . 1 "                        " "N"   0 10   8   800   60  2  2  8  7 . 1
221 2010 1  . 2 "                        " "N"   5 15   8  1500  100  5  1  7  . 2 .
207 2010 1  . 1 "                        " "N"   0 16   8  1600    .  4  2 11  6 . .
644 2010 1  . 1 "                        " "N"   0 10   6  1500    .  . 26  .  7 . .
624 2010 1  . 1 "                        " "N"   0 15   6   800    .  8  . 31  . . .
778 2010 1  . 1 "                        " "N"   0 15   6  1500    .  .  . 14  . . .
617 2010 1  . 1 "                        " "N"   0 26   6  1400    .  .  . 31  . . .
221 2010 1  . 1 "                        " "N"   0  3   8   180   60  .  . 20  4 4 .
666 2010 1  . 1 "                        " "N"   0 10   6   500    .  .  2 31  8 . .
619 2010 2 25 5 "                        " "N"  12 30   4  4500    .  .  . 25  . . .
755 2010 1  . 1 "                        " "N"   0 12   6  1200    .  .  2 15  . . .
611 2010 1  . 1 "                        " "N"   0 20   7  3500    .  .  5  4  . . .
837 2010 2  7 1 "                        " "N"   0  5   8   500    .  .  .  .  . . .
388 2010 1  . 1 "                        " "N"   0 20   8  1200    .  .  . 12  3 . 1
670 2010 2 15 2 "                        " "N"   9 10   8  2000    .  .  .  .  . . .
643 2010 1  . 1 "                        " "N"   0  4   6   240    .  .  8 31 12 . .
383 2010 2  1 5 "                        " "Y" 100 30   8  4000    .  .  .  .  . . .
396 2010 1  . 1 "                        " "N"   0  6   8   900    .  .  .  4  8 . .
399 2010 1  . 1 "                        " "N"   0 15   8   750    .  .  .  6  3 . .
382 2010 2  1 5 "                        " "Y" 100 28   8  7000    .  .  .  .  . . .
409 2010 2 25 1 "                        " "N"   0 12   8  1800    .  .  .  4  . . .
374 2010 2 25 2 "                        " "N"   5 10   5   700  250  .  .  .  . . .
383 2010 2 21 1 "                        " "N"   0 10   8  2100    .  .  . 15  . . .
379 2010 2 21 1 "                        " "N"   0 25   8     .    .  .  . 10  . . .
387 2010 1  . 1 "                        " "N"   0 15   8   900    .  8  . 12  . . 2
612 2010 2 20 1 "                        " "N"   0 16   2   300    .  .  1 30  . . .
843 2010 2  7 1 "                        " "N"   0  3   8   300    .  .  .  .  . . .
375 2010 2 25 5 "                        " "Y"  10 30  12  1500 1000  .  .  1  . . .
413 2010 1  . 1 "                        " "N"   0 15   8  2250    .  3  .  4 12 . .
267 2010 2 20 2 "                        " "N"   4 12   8  1200    .  2 13  4  2 . .
412 2010 2 15 2 "                        " "N"  12 15   8  3000    .  .  .  .  . . .
397 2010 1  . 1 "                        " "N"   0 20   7  1000    .  .  .  8  . . 1
386 2010 2 25 1 "                        " "N"   0 10   6  2000    .  .  .  4  . . .
376 2010 1  . 1 "                        " "N"   0 15   8  3100    .  .  .  3  4 . .
 37 2010 1  . 1 "                        " "N"   0 10   8  1000    .  .  . 10  . . .
712 2010 1  . 1 "                        " "N"   0 10   8   400    .  .  . 20  . . .
380 2010 1  . 1 "                        " "N"   0 20   8  1400    .  3  . 10  . . 1
190 2010 1  . 1 "                        " "N"   0 24  10  6000    .  .  6  .  7 . .
107 2010 2 20 1 "                        " "N"   0  6   9   900   24  .  . 15  . . .
383 2010 1  . 1 "                        " "N"   0 10   8  1500    .  .  .  3  4 . .
374 2010 1  . 1 "                        " "N"   0 18   8  2700    .  .  .  1  2 . .
119 2010 1  . 1 "                        " "N"   0 11   8  1650   44  . 10  . 18 . .
408 2010 2  1 5 "                        " "Y" 109 25   8  3000    .  .  .  .  . . .
393 2010 2  1 5 "                        " "Y" 109 30   9  3000    .  .  .  .  . . .
408 2010 1  . 1 "                        " "N"   0 15   8   750    .  .  . 12  . . .
715 2010 2 25 5 "                        " "N"  12 26  10  2600    .  .  .  .  . . .
410 2010 2 19 4 "                        " "Y"  15 25   6  6500    .  .  .  .  . . .
572 2010 1  . 1 "                        " "N"   0 18   6  2900    .  .  .  1  3 . .
405 2010 2 18 1 "                        " "N"   0 25   8  5250    .  .  .  3  2 . .
293 2010 1  . 1 "                        " "N"   0 10   8  1500  100  .  . 15  . . 5
760 2010 1  . 1 "                        " "N"   0 10   6  1500    .  .  8  .  7 . .
573 2010 1  . 1 "                        " "N"   0 13   6  1300    .  .  4 18  2 . .
836 2010 2  7 1 "                        " "N"   0  5   8   400    .  6  .  4  4 . .
101 2010 2  1 1 "                        " "N"   0 30   8  4400    .  .  . 16  . . .
537 2010 2 25 5 "                        " "N"   . 20   8  6900    .  .  .  3  . . .
635 2010 1  . 1 "                        " "N"   0 15   6   750    .  6  . 31  . . .
261 2010 2 20 2 "                        " "N"   4 23   8  2400    .  2  .  5  . . .
652 2010 1  . 1 "                        " "N"   0 24   6  1200    .  .  3 31  . . .
479 2010 1  . 1 "                        " "N"   0 28   8  4200    .  .  1  4  1 . .
338 2010 2 20 1 "                        " "N"   0 12   8  1200  200  .  . 21  5 . .
 95 2010 1  . 1 "                        " "N"   0 12   8  1200   48  7 10 15  . . .
827 2010 1  . 1 "                        " "N"   0  3   8   210    . 10  . 10  4 . .
434 2010 1  . 1 "                        " "N"   0  4   8   400    .  . 15  8  3 . .
640 2010 2  6 1 "                        " "N"   0  8   9  1060    .  .  4  .  8 . .
667 2010 2 20 1 "                        " "N"   0  7   8   875    .  .  5  4  . . .
582 2010 1  . 1 "                        " "N"   0 10   6  1500    .  .  3  1  . . .
 68 2010 2 12 1 "                        " "N"   0 31   3  1000    .  .  .  .  9 . .
196 2010 1  . 1 "                        " "N"   0 15   8  1800    .  3  8  9  . . .
464 2010 2 23 3 "                        " "N"  45 31   8 15500    .  .  .  1  . . .
671 2010 1  . 1 "                        " "N"   0  8   4   600    .  .  6  8 21 . .
409 2010 2 25 1 "                        " "N"   0 14   8  2800    .  .  .  3  . . .
 99 2010 1  . 1 "                        " "N"   0  5   8   750   20  .  .  .  . . .
294 2010 1  . 1 "                        " "N"   0 18   8  2700  200 10  .  2  . . .
392 2010 2  1 5 "                        " "Y" 100 30   8  7000    .  .  .  .  . . .
293 2010 1  . 1 "                        " "N"   0 12   8  1800  100  8  .  5  . 3 2
789 2010 1  . 1 "                        " "N"   0 23   6  2300    .  .  . 12  . . .
 78 2010 1  . 1 "                        " "N"   0 16   8  1600   64  4  3 14  . . .
760 2010 2 23 1 "                        " "N"   0  9  12  9000    .  .  .  .  . . .
574 2010 1  . 1 "                        " "N"   0  4   6   600    .  .  .  2  8 . .
456 2010 1  . 1 "                        " "N"   0  5   8   500    .  .  .  8  4 . .
774 2010 2  1 2 "                        " "N"   3 26   8  3000    .  .  4  .  . . .
end
label values HH_ID HH_ID1
label def HH_ID1 3 "IAPA0010", modify
label def HH_ID1 28 "IAPA0220", modify
label def HH_ID1 37 "IAPA0233", modify
label def HH_ID1 68 "IAPA0330", modify
label def HH_ID1 78 "IAPB0038", modify
label def HH_ID1 95 "IAPB0205", modify
label def HH_ID1 99 "IAPB0258", modify
label def HH_ID1 101 "IAPB0260", modify
label def HH_ID1 107 "IAPB0281", modify
label def HH_ID1 119 "IAPB0299", modify
label def HH_ID1 132 "IAPC0030", modify
label def HH_ID1 142 "IAPC0040", modify
label def HH_ID1 177 "IAPD0009", modify
label def HH_ID1 190 "IAPD0042", modify
label def HH_ID1 196 "IAPD0048", modify
label def HH_ID1 207 "IAPD0059", modify
label def HH_ID1 212 "IGJA0001", modify
label def HH_ID1 221 "IGJA0010", modify
label def HH_ID1 244 "IGJA0052", modify
label def HH_ID1 261 "IGJB0010", modify
label def HH_ID1 267 "IGJB0035", modify
label def HH_ID1 293 "IGJC0002", modify
label def HH_ID1 294 "IGJC0003", modify
label def HH_ID1 338 "IGJD0006", modify
label def HH_ID1 374 "IKNA0001", modify
label def HH_ID1 375 "IKNA0003", modify
label def HH_ID1 376 "IKNA0004", modify
label def HH_ID1 379 "IKNA0007", modify
label def HH_ID1 380 "IKNA0008", modify
label def HH_ID1 382 "IKNA0010", modify
label def HH_ID1 383 "IKNA0030", modify
label def HH_ID1 386 "IKNA0033", modify
label def HH_ID1 387 "IKNA0034", modify
label def HH_ID1 388 "IKNA0035", modify
label def HH_ID1 392 "IKNA0039", modify
label def HH_ID1 393 "IKNA0040", modify
label def HH_ID1 396 "IKNA0043", modify
label def HH_ID1 397 "IKNA0044", modify
label def HH_ID1 399 "IKNA0046", modify
label def HH_ID1 405 "IKNA0052", modify
label def HH_ID1 408 "IKNA0055", modify
label def HH_ID1 409 "IKNA0056", modify
label def HH_ID1 410 "IKNA0057", modify
label def HH_ID1 412 "IKNA0059", modify
label def HH_ID1 413 "IKNA0060", modify
label def HH_ID1 434 "IKNB0040", modify
label def HH_ID1 456 "IKNC0002", modify
label def HH_ID1 461 "IKNC0007", modify
label def HH_ID1 464 "IKNC0010", modify
label def HH_ID1 473 "IKNC0038", modify
label def HH_ID1 479 "IKNC0044", modify
label def HH_ID1 488 "IKNC0053", modify
label def HH_ID1 495 "IKND0001", modify
label def HH_ID1 499 "IKND0005", modify
label def HH_ID1 537 "IMHA0003", modify
label def HH_ID1 572 "IMHA0203", modify
label def HH_ID1 573 "IMHA0204", modify
label def HH_ID1 574 "IMHA0206", modify
label def HH_ID1 582 "IMHA0261", modify
label def HH_ID1 611 "IMHB0001", modify
label def HH_ID1 612 "IMHB0002", modify
label def HH_ID1 617 "IMHB0035", modify
label def HH_ID1 619 "IMHB0040", modify
label def HH_ID1 624 "IMHB0047", modify
label def HH_ID1 635 "IMHB0062", modify
label def HH_ID1 638 "IMHB0202", modify
label def HH_ID1 640 "IMHB0204", modify
label def HH_ID1 641 "IMHB0205", modify
label def HH_ID1 643 "IMHB0207", modify
label def HH_ID1 644 "IMHB0208", modify
label def HH_ID1 652 "IMHB0220", modify
label def HH_ID1 655 "IMHB0223", modify
label def HH_ID1 658 "IMHB0226", modify
label def HH_ID1 666 "IMHB0238", modify
label def HH_ID1 667 "IMHB0239", modify
label def HH_ID1 670 "IMHB0242", modify
label def HH_ID1 671 "IMHB0243", modify
label def HH_ID1 712 "IMHC0213", modify
label def HH_ID1 715 "IMHC0216", modify
label def HH_ID1 755 "IMHD0053", modify
label def HH_ID1 759 "IMHD0057", modify
label def HH_ID1 760 "IMHD0058", modify
label def HH_ID1 774 "IMHD0227", modify
label def HH_ID1 778 "IMHD0279", modify
label def HH_ID1 789 "IMHD0293", modify
label def HH_ID1 827 "IMPA0003", modify
label def HH_ID1 836 "IMPA0031", modify
label def HH_ID1 837 "IMPA0032", modify
label def HH_ID1 843 "IMPA0038", modify
------------------ copy up to and including the previous line ------------------