Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: help on data format


From   "MITRA PINAKI (MAR1PXM)" <[email protected]>
To   <[email protected]>
Subject   st: help on data format
Date   Wed, 27 Apr 2005 08:59:32 -0400

Hello List,

    I have several text files which contains data elements like the
following:
Var 1	Customer #	3427
Var 2	State Name	GA
Var 3	Order Qty	900,000
Var 4	Start Date	9/20/2004
Var 5	Incentive Structure
	First Level		31.56
	Second Level	58.22
	Third Level  	7.8
	Forth Level 	0
	Fifth Level 	2.43
Var 6	Weekly     	Sales
Week1	9/27/2004	$425,755
Week2	10/4/2004	$229,226
Week3	10/11/2004	$160,841
Week4	10/18/2004	$145,643
Week5	10/25/2004	$101,873
Week6	11/1/2004	$97,313
Week7	11/8/2004	$66,184
Week8	11/15/2004	$43,848
Week9	11/22/2004	$38,841

Each text file contains data for a single customer. I would like to
combine these text file to create a data set for all the customers and
make the second column as variable names and have third columns as the
values for the variables. So, it will look like the following:
Customer# StateName OrderQty
StartDate...ForthLevelIncentive.....Week9/27/04
     3427        GA  900,000   9/20/04                     0
425,755

I attempted with reshape but didn't work out. Can anyone please provide
me any help?

Thank you.

Sincerely,
Pinaki Mitra

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index