Importing data into Stata

423 views
Skip to first unread message

5forwards

unread,
Jun 18, 2014, 8:34:14 AM6/18/14
to opensecret...@googlegroups.com
Hi everyone. I am struggling to import PAC data into Stata. I know that the files are comma delimited and use pipes as qualifiers but for some reason I always end up with a messy file. Has anyone had success in using  stata to import the data? 

Thanks!

CJ Libassi

unread,
Jun 19, 2014, 7:01:42 AM6/19/14
to opensecret...@googlegroups.com
Yeah, unfortunately because the Import Delimited Command from Stata automatically recognizes all delimiters, the commas in some of the PAC names will throw off the import. The key is to do a find and replace in the text file where you replace all pipes with quotes (Find: | Replace with: "). Because these files are so big, it was my experience that the find and replace actually takes a few minutes, and is fastest on computers with more memory. 

After you've done the find and replace it should be a fairly straightforward import. 

Hope this helps!

CJ 

5forwards

unread,
Jun 26, 2014, 11:38:33 AM6/26/14
to opensecret...@googlegroups.com
Worked perfectly, thanks!
Reply all
Reply to author
Forward
0 new messages