Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: merge table by table


From   Minsoo Kim <ibsulkim@gmail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: merge table by table
Date   Wed, 13 Jul 2011 11:22:20 -0500

Hi,

I am trying to merge two data sets, each has 600 tables
with headers on each table and with two empty rows between each table.
And I would like to merge table by table as below:

[Data set 1]

Name  FileYr   Table   Asset   V5  V6  V7  V8
AB       2000      BS     1997    6    14    6    2
AB       2000      BS     1998    12    7    9    1

Name  FileYr   Table  Liabilities  V9    V10    V11  V12
AB       2000      BS     1997       1      18      17     4
AB       2000      BS     1998       10      7      42     5

[Data set 2]

Name  FileYr   Table   Asset   V5  V6  V7  V8  V14
AB       2001      BS     1998    12    7    9    1
AB       2001      BS     1999    5    21    5   11   22

Name  FileYr   Table  Liabilities  V9    V10    V12
AB       2001      BS     1998       10      7       5
AB       2001      BS     1999       71      60     40

[Goal Data Set]

Name  FileYr   Table   Asset   V5  V6  V7  V8  V14
AB       2000      BS     1997    6    14    6    2
AB       2000      BS     1998    12    7    9    1
AB       2001      BS     1999    5    21    5   11   22

Name  FileYr   Table  Liabilities  V9    V10    V11  V12
AB       2000      BS     1997       1      18      17     4
AB       2000      BS     1998       10      7      42     5
AB       2001      BS     1999       71      60            40

Merge command itself cannot work properly because
it considers headers as body of data.
Can anyone please help me to resolve this issue in a right way?

Any comment will be greatly appreciated.

Thanks,

-- 
Minsoo Kim
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index