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]

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


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: why messy when importing a csv file?
Date   Thu, 6 May 2010 18:10:56 +0100

Three points: 

1. I don't think that this kind of behaviour can in any sense be
inferred or even guessed from your description "messy". Thus you wasted
your previous email, and the time anyone spent reading it and pondering
a reply. 

2. I copied your file fragment previously posted and did not get this
behaviour. 

3. You should inspect your file for strange characters using a decent
text editor or Stata's -hexdump- or Stata's -type-. Just because it is
called .csv doesn't mean that much. There could be other stuff in it
too. 

Nick 
[email protected] 

Jessie Grace

Neil,
the results are as follows. There are only one variable named v1 and 23
observations the number of which is not equal to my csv file. More, all
values of the observations are blank.
 
. list
     +----+
     | v1 |
     |----|
  1. |    |
  2. |    |
  3. |    |
  4. |    |
  5. |    |
     |----|
  6. |    |
  7. |    |
  8. |    |
  9. |    |
 10. |    |
     |----|
 11. |    |
 12. |    |
 13. |    |
 14. |    |
 15. |    |
     |----|
 16. |    |
 17. |    |
 18. |    |
 19. |    |
 20. |    |
     |----|
 21. |    |
 22. |    |
 23. |    |
     +----+

> From: [email protected]
>
> On Thu, May 6, 2010 at 4:47 PM, Jessie Grace wrote:
>> Dear statalists,
>>
>> 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.
>
> What does "messy" look like? If you could -list- the data and copy
> and paste it to the list then...
>
>> Could anyone tell me why and how to solve?
>
> ...this might be more achievable, otherwise its just guessing.

*
*   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