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   Nikolaos Kanellopoulos <nkkanel@yahoo.gr>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Read csv in Stata
Date   Tue, 22 Oct 2013 07:13:44 +0100 (BST)

Dear Sergiy and Haluk,

Thank you very much for your help. I adjusted Sergiy's do file to my needs and it works like a charm.

Best,
Nikos




----- Original Message -----
From: Sergiy Radyakin <serjradyakin@gmail.com>
To: "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Cc: 
Sent: Monday, 21 October 2013, 16:53
Subject: Re: st: Read csv in Stata

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
<nkkanel@yahoo.gr> 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?searchhttp://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