Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: RE: why messy when importing a csv file?


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: why messy when importing a csv file?
Date   Thu, 6 May 2010 17:53:59 +0100

No definition of "messy" here. 

My guess: By default your third variable will be -float- type and will
be assigned a format %8.0g. That wouldn't look exactly like the original
without resetting the format. 

Otherwise put: without specifying more information, you are in effect
_asking_ for Stata's default treatment in terms of storage types and
formats. So, the results shouldn't seem surprising. 

Nick 
n.j.cox@durham.ac.uk 

Jessie Grace
 
I have a .csv file, which consists of the following.
 
Stkcd,Accper,A001101000
000002,"1999-06-30",468010960.13
000002,"2002-09-30",1166858479.70
000002,"2000-01-01",772831829.15
000002,"2000-06-30",911966043.54
000002,"2000-12-31",995745160.05
000002,"2009-03-31",26921921879.80
000002,"1997-06-30",0
000002,"1991-12-31",88628783.34
000002,"1992-12-31",204653478.04
000003,"1998-12-31",120946052.36
 
The first row contains variables names. The characteristic of the file
is the contents of each row are in the same cell. 
No matter I typed "insheet using firms.csv" or "insheet using
firms.csv,comma", the importing results are messy.
Could anyone tell me why and how to solve?

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index