3

I want to import data from a CSV file into Stata. The problem is that sometimes, there is a newline inside a string.

Example input CSV:

Smith, "John F."
Kennedy, "Michael
J."

How can I import this into Stata?

user1769925
  • 588
  • 1
  • 6
  • 15
  • Look at the reference below for a discussion of a similar problem. [http://www.statalist.org/forums/forum/general-stata-discussion/general/1186430-end-of-file-problems](http://www.statalist.org/forums/forum/general-stata-discussion/general/1186430-end-of-file-problems) –  May 27 '15 at 22:44
  • Thanks, I am familiar with the filefilter command. The problem is that I cannot replace the newline with anything because that of course messes up the entire CSV file, which needs to have a newline at the end of every record – user1769925 May 27 '15 at 23:07
  • 2
    See http://stackoverflow.com/q/29378372/2077064 for a similar question, with answers. – Roberto Ferrer May 27 '15 at 23:10
  • 1
    Thanks Roberto, I did not find this entry when I had searched stackoverflow before! Adding bindquote(strict) to my import delimited solved it for me! – user1769925 May 27 '15 at 23:14

0 Answers0