Announcement

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

  • Importing CSV with multiine text data

    I am trying to import a CSV file in which some of the columns contain multiline text data. See below. Sample file attached.
    Click image for larger version

Name:	Screenshot 2021-10-25 132653.png
Views:	2
Size:	82.6 KB
ID:	1633148


    However, when I run the
    Code:
    import delimited
    command, Stata seems to get confused, apparently by many of the characters, returns the message:
    Note: Unmatched quote while processing row 2; this can be due to a formatting problem in the file or because a quoted data element
    spans multiple lines. You should carefully inspect your data after importing. Consider using option bindquote(strict) if
    quoted data spans multiple lines or option bindquote(nobind) if quotes are not used for binding data.
    and loads a nonsensical frame. See:
    Click image for larger version

Name:	Screenshot 2021-10-25 132521.png
Views:	1
Size:	43.0 KB
ID:	1633149
    Attached Files
    Thank you for your help!

    Stata SE/17.0, Windows 10 Enterprise

  • #2
    Looks like Stata was already providing me the answer. The following worked for me:
    Code:
    import delimited using "output-16350782302.csv", bindquote(strict) maxquotedrows(10000)
    Thank you for your help!

    Stata SE/17.0, Windows 10 Enterprise

    Comment


    • #3
      Hmmm...now I am trying to export CSV and having the same issue....
      And Stata tells me that bindquote and maxquotedrows are not kosher, when used in conjunction with export delimited or save ...

      Tearing my hair out...
      Thank you for your help!

      Stata SE/17.0, Windows 10 Enterprise

      Comment

      Working...
      X