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: Read csv in Stata


From   Sergiy Radyakin <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Read csv in Stata
Date   Mon, 21 Oct 2013 09:53:21 -0400

Nikos, type in Stata (not in the browser):

do http://radyakin.org/statalist/2013102101/convert.do

Best, Sergiy Radyakin

On Mon, Oct 21, 2013 at 8:56 AM, Nikolaos Kanellopoulos
<[email protected]> wrote:
>
> Dear all,
>
> I have a set of csv files which I want to read into Stata. Their first two lines are:
>
> Year,Reporter Code,Trade Flow Code,Partner Code,Classification,Commodity Code,Quantity Unit Code,Supplementary Quantity,Netweight (kg),Value,Estimation Code
> "2005,826,1,0,""H2"",""030211"",8,461906,461906,2554127,0"
>
> Unfortunately in order to use insheet the second line must become
> 2005,826,1,0,"H2","030211",8,461906,461906,2554127,0
>
> ie lose leading and ending double quotes and replace the double double quotes with double quotes.
>
> To do these I use a text editor, but because the files have many observations this takes too long.
> Do you have any idea of how I can do that faster and preferably in Stata.
>
> Thanks for your time.
> All the best,
> Nikos
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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