Announcement

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

  • Stata (Mac) can't find .csv file from Redcap ?

    Dear all, I am new user for Stata and Redcap, I try to export files from Redcap for Stata and I have downloaded 2 files 1).do file and 2) .csv file in same folder in my Macbook then I run .do file by Stata ver 15 program but Stata show "...csv file not found"(as picture).I have already recheck .csv file name, that is correct no blank in .csv file name. How can I fix this problem, thank you
    Attached Files

  • #2
    The file either isn't there in your working directory you say it's in, or, your current working directory isn't set to where the file is. In the future, please don't post screenshots of code, just use
    Code:
    
    
    (the number sign next to the quotation marks in the toolbar) and put your code within those delimiters.

    Comment


    • #3
      Add the command
      Code:
      pwd
      just before the import delimited in the do-file from Redcap, and make sure the current working directory that it reports is indeed the directory containing the data. Then run
      Code:
      dir
      and make sure that you typed the file name correctly.

      Comment


      • #4
        It's work, Stata can found csv file , thank you so much

        Comment


        • #5
          I also have the same issue as the original poster - I used advice from this forum previously to get it to work but now am having the same issue. I am running Stata on a Mac, trying to import data from REDCap, states the csv file not found even when I update the file path. I can import the csv file, but then there are no labels if I cannot use the do file. I would like to be able to use the import function with the do file but If anyone can outline how to import the labels from REDCap that would be a helpful work around to this issue. EDITED TO ADD: I was able to figure this out by changing the file name (deleted underscores and hyphens, not sure which one was the issue).
          Last edited by Heather Faulkner; 06 Oct 2022, 10:35.

          Comment

          Working...
          X