Solved

Change Source from multiple Workbenches

  • 21 February 2022
  • 4 replies
  • 2 views

My Data moved from Network drive A to Network drive B.

Is there a way to mass change the Source Paths from the Readers in multiple Workbenches at once or do i need to open every Workbench and need to change it manually?

icon

Best answer by nielsgerrits 21 February 2022, 16:14

View original

4 replies

Userlevel 6
Badge +31

An alternative is to read workbenches as text, use a StringReplacer to replace the full path. It is hacky, and probably not supported, so use at your own risk. (Backup your workspaces!)

Badge +20

I support @nielsgerrits​'s solution.

Read as text, look for 

SourceDataset

Your path will be between quotation marks. Do a little transforming on the data, make sure you preserve the line order and write back as text.

Another solution would be reading as fmw (supported) but writing is trickier, writing as xml should work but I never figured it out.

Userlevel 4

An alternative is to read workbenches as text, use a StringReplacer to replace the full path. It is hacky, and probably not supported, so use at your own risk. (Backup your workspaces!)

I agree about this. I think the key to this working is to make sure that the substring to look for and replace must be completely unique, i.e. no risk of accidentally replacing some other but similar substring.

 

Userlevel 4
Badge +25

Hi. I made this my Question of the Week because I thought it was so interesting. You can find a video demo of my thoughts here: https://www.youtube.com/watch?v=bjZRcyYuOjU&t=1611s

 

In short - I'm not going to say don't use the StringReplacer, but the official solution I think would be to use relative paths, which you'd have to set up beforehand. The video shows how.

Reply