Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • The result of importing csv file into Stata is quite strange.

    Dear Statalists,

    I get a problem when am trying to import a csv file into Stata: File > import > Text data (delimited, *csv). Stata works, but the result is quite strange. The new data.dta file mixed up the values of variables. Thank you so much if you can help me with that.

    Sincerely
    Attached Files

  • #2
    Why don't you post one line from the original file and one line from Stata's interpretation. My first thought is that B8_9 has some text with commas, and is not quoted but that is a wild guess since I haven't seen the original. I don't think there is a simple cure for that, other than editing the file by hand.

    Comment


    • #3
      if the guess in #2 is correct, the -filefilter- command may help; see
      Code:
      h filefilter

      Comment


      • #4
        Your CSV has quoted strings that include within them line breaks.

        In the Import dialog box, change the "Quote binding" option from "Loose" to "Strict".

        Comment

        Working...
        X