Announcement

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

  • Moving many files into OneDrive

    Hello all,
    I have a question please. I worked on many projects on Stata. All the data was stored in my local hard drive. Recently, I realized the importance of uploading my files to the internet. So, I want to upload all of my files to OneDrive.
    The problem is: In the doi files, I used to write ALOT of merge, import, use, etc commands. In all of those, I specified a path (destination) to the folder I am using. For example, import D:\Folder1\Folder2\Folder3.
    Now, when I upload (move) all of my files to OneDrive, ALL of these commands will not work because the right code should be: import D:\OneDrive_CompanyName\Folder1\Folder2\Folder3.
    Note: I was thinking about changing the working directory in each doi file but I do not think this solution is going to work.

    So, can you please guide me on how can I upload (move) my files to OneDrive without needing to adjust all of my doi files to reflect the right path?

    I would be very grateful if anyone can share any solution, tips, or insights.
    Thank you so much all.
    Kind regards.

  • #2
    I cannot give you an answer, but I can share my experience of OneDrive.
    I was in the same situation and I had no choice but to revise Do files. Neither Microsoft nor our IT could help me.
    I recommend you to use other text editors (with replace 'all' option) if you have a long script.
    C
    Last edited by Chul Lee; 19 Feb 2022, 20:26.

    Comment


    • #3
      You may find the filefilter command helpful. Something like the following.
      Code:
      rename task1.do old_task1.do
      filefilter old_task1.do task1.do, from("D:\") to("D:\OneDrive_CompanyName\")
      should create a new version of task1.do replacing "D:" with "D:\OneDrive_CompanyName" throughout.

      This can the be automated using the filelist command written by Robert Picard and available from SSC using
      Code:
      search filelist
      to search your directories for do-files and then looping over the results.

      Comment


      • #4
        Alternatively you could reshuffle your drive mappings and make sure that D: maps to a folder that gets synced to the cloud.

        Comment

        Working...
        X