Wednesday 18 November 2015

How to replace a directory using QGIS Field calculator?


I have a column called Hotlink full of incorrect directories and I need to edit them.


They currently read C:/ABCD/filename.pdf and I want them to read C:/Maps/ABCD/ABCD/filename.pdf


The script I'm trying to use but not having much luck with is as follows: replace ("Hotlink", '(ABCD)', '(Maps/ABCD/ABCD)');


How can I get this to work?



Answer



So we have a definite answer to the question:



The problem involves QGIS not liking the backslash


try this


replace ("Hotlink" , 'ABCD' , 'Maps\\ABCD\\ABCD')


see esdm.co.uk/qgis-field-calculator-backslash-gotcha


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...