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]

st: Read csv in Stata


From   Nikolaos Kanellopoulos <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Read csv in Stata
Date   Mon, 21 Oct 2013 13:56:30 +0100 (BST)

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/


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