Migrating GM workspaces to new computer

vieuxdelamontagnevieuxdelamontagne Global Mapper UserPosts: 66Trusted User
I've been forced to buy a new computer that identifies most of the hard drive as "D:" rather than "C:". I have several hundred GM workspaces that have been routinely saved in such a way that path names have "C:" hard-coded. Is there any easy way to batch-edit these workspace files so that they recognize the path names as referring to the "D:" drive? 

Answers

  • Amanda McDermottAmanda McDermott Global Mapper User Posts: 57Trusted User
    Sounds like it might be easier to re-name the drive? There is certainly a way to do that on my computer, I expect there will be on yours. Hope that helps!
  • vieuxdelamontagnevieuxdelamontagne Global Mapper User Posts: 66Trusted User
    Well, I think this might work, and I think you're right that it would be easier to re-map the drive. Trouble is, the "C:" drive exists, is small, and contains all of the Microsoft schlock that can't be tampered with. So I don't think I can re-name the "D:" drive to "C:" without disrupting a lot of other functionality. Another concern is that while some of the content of the .gmw files is just ASCII text, there is also binary data embedded in many of them, so I'm afraid that if I were to do a global find-and-replace of all "C:" instances to "D:", I'd accidentally be editing something I don't want to change, and don't understand. 

    Any other suggestions?
  • BillBBillB Global Mapper User Posts: 83Trusted User
    vieuxdelamontagnw
    You are correct to think that you couldn't just rename D: drive to C: - it would break the file/operating system.  In fact I would guess the system wouldn't let you.

    Regarding mass renaming:

    1) Notepad++ is a great (free) text editor and it can search and replace through multiple files - you can specify a folder path and a .gmw extrension if you want.

    2) Presumably your GMW files were not just on C: 'root', that is, they were not filed as
    C:\File1.gmw,
    C:\File2.gmw

    They would have been in a folder.  So you can search in Notepad++ for (file type *.gmw) in your new drive/folder (let's say it is D:\GlobalMapper)

    Search text: "C:\Program Files\GlobalMapper"
    Replace text: "D:\GlobalMapper"

    There should be very little danger of you replacing binary data with a string like that.

    Hope that helps.  Just go carefully with the search and replace in files - it is a powerful function.  Perhaps test on just a couple of files first and see if they work OK, before you start on the several huindred.

  • BillBBillB Global Mapper User Posts: 83Trusted User
    Sorry that this forum thinks D followed by a colon is a sad face!
  • KatrinaKatrina Posts: 23
    A workspace is a script file, so you can open it with a text editor like notepad. You will see mostly the filename= parameter within IMPORT commands that you would want to update. 

    Global Mapper also will automatically look in a path relative to the loaded workspace if it can't find the data at the original path. So if your data is in a subfolder below the workspace file, it will find it automatically. 
    If you open a workspace and it can't find the data, it will ask you to locate the file, listing the original filename at the top of the dialog. If other data is in the same directory is should find that automatically. 
  • BillBBillB Global Mapper User Posts: 83Trusted User
    That is true, and a very helpful function for single files - we often use it when transferring a GMW from an isolated laptop to networked PC.  But you have to Save the GM workspace after opening and correcting each file.  So, if you have several hundred files, as the OP suggests, being able to batch replace filepaths would be likely to be more convenient and faster.
Sign In or Register to comment.