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]

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


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

Just to pre-empt further speculation: 

Grace Jessie sent me her file [unsolicited]. It is a .csv file but as
Steve Samuels and I guessed it is NOT plain text (ASCII). 

I urged Grace to close the thread on Statalist with the explanation. 

General notes:

1. Being new on Statalist doesn't excuse you from paying attention to
advice available. All new joiners are asked to read the FAQ before
posting for precisely that reason. 

2. Private emails to people active on Statalist who you don't know
personally usually  waste people's time. This too is explained fully in
the FAQ. 

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

Sarah Edgington

And here we further demonstrate that sometimes stuff happens and things
get
corrupted.
My first line should have read "You don't mention how you're downloading
the
csv file or what you're using to save a new one."
I have no idea whatsoever what happened there.  I'm going to blame it on
Outlook.

Sarah Edgington

to save a new one.  Depending on how big the data set is the solution of
simply copying the contents of the file to the editor window and saving
a
stata dataset might be the easiest.  Otherwise you need to make sure
that
you're saving a csv file that doesn't have extraneous information in it
that
Stata can't use.  

You say "The characteristic of the file is the contents of each row are
in
the same cell."  What does this mean?  Are you referring to the fact
that
the value of the first variable is repeated?  If so, that isn't a
problem.
If you mean something else, particularly something having to do with the
way
the end of the line is treated in the file then you have a problem.  Are
you
saying that if you open the csv file in a spreadsheet program you get
all 25
lines of data in a single row of the spreadsheet?  If so, that's likely
going to cause issues.  What does the csv file look like in a really
basic
text editor (for example on a windows machine what does it look like if
you
open it in notepad, not wordpad or word, but notepad)?  Or alternatively
what do you get if you enter " type firms.csv " in Stata?


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