Search & Replace

Previous Top Next


To set search&replace strings, to set in which document area replacement should be done, to influence backup of documents and more you will need to click on Search & Replace button in Search&Replace tab graphic. This will initially show recommendation popup


graphic


as we strongly recommend that you backup documents during processing with ReplaceMagic



If you are in "Replace with" field by pressing enter both strings will be copied in table above. Same will happen also if you press on + button.


If you select one of row in the table by pressing - button row will be deleted.


If you double click on one of rows search&replace strings will be copied in text fields ("Search for" and "Replace with") allowing you to make changes. Of course, by pressing enter in "Replace with" field or by pressing + button updated strings will be copied in the table above.



Here you can set in which document area ReplaceMagic should do replacement:




  • Hyperlinks
  • OLE Objects
  • Link Sources (Word, Excel & Powerpoint)
  • Notes (Powerpoint)
  • Document Properties
  • Footnote (Word)
  • Pivot Tables (Excel only)
  • Field Codes (Word only)
  • Bookmarks (Word)
  • Document Template
  • Formulas (Excel)
  • Attached Template (Word)
  • PowerQuery Source (Excel only)
  • Field Codes
  • VBA
  • Header
  • Footer
  • Comments
  • Text


In case that you have license also for PDF documents following area are available:

  • Hyperlinks
  • Annotations
  • Document Properties
  • Text (BETA)


In case of LNK version you will see:




And in case of Text & Email:



Important: in case of changes in SharePoint .aspx pages you have to ensure that used user does not have denial on permission to "Add and Customize Pages":

If this is the case changes will be done but published pages will be unpublished.


In case of SharePoint




  • Setting "Update SharePoint Wiki/Canvas page content" - will make changes of content that is shown in SharePoint pages which is stored in SharePoint database. For information - SharePoint pages have real file which contains formatting and is place holder to show content stored in SharePoint DB. With this option ReplaceMagic can change also content not stored in SharePoint pages (most likely, aspx files) but also in SharePoint DB.

    Important: in case of changes in SharePoint .aspx pages you have to ensure that used user does not have denial on permission to "Add and Customize Pages":

    If this is the case changes will be done but published pages will be unpublished.

  • (BETA) Setting "Update SharePoint List Items hyperlinks & Discussion Board items" - will allow you to make changes in SharePoint list item fields of type hyperlinks or in body fields of Discussion Boards (text and links also). 
    Remark (for list items): if you make change new hyperlink will need to start with http/https/ftp/mail or similar as otherwise SharePoint will not allow changes. This same applies if you try to enter something wrongly directly over SharePoint.

    Parameter "Keep "Last modified date" and "Editor" values" will always work for lists stored in SharePoint Online. & on-prem versions of SharePoint will always get updated date and editor name. In both cases ReplaceMagic cannot keep approval or publishing status of list items.

    In case that this is important do not use ReplaceMagic to make changes in list items and discussion boards.

    Remark: in case that there are also changes of list item attachments (documents), they will have priority to list item fields meaning that documents will be updated but list item fields might be skipped. This is especially if you are running multiple replacement runs against same selection (list attachments and list items). To update list item fields (URL type of field), we recommend to run those changes separately from list attachment replacements.

    Due to very high pace of replacements SharePoint, depending on platform load, might not be capable to cope with replacements throughput which means that some changes will not be saved. Recommendation is, that after first replacement run, to re-run replacements on lists until nothing is reported in replacement result.

    IMPORTANT: As replacements of list items are causing very high workload on SharePoint side, Microsoft might block processing causing unexpected closure of ReplaceMagic. To reduce workload, ReplaceMagic will throttle processing to single list at a time. After list processing is completed, ReplaceMagic will automatically increase parallelism to the application configuration for further document processing. Due to very high pace of replacements, SharePoint might not update all URL-type fields in one run thus recommendation is repeat list processing until not all changes are done. Please note that list item processing is currently in BETA, and, due to this limitation, it is provided without warranty.
    It is recommended not to run more than few lists in parallel to avoid blockage by SharePoint. Additionally, ReplaceMagic will introduce 3 seconds break between processing lists to relaxed a bit pressure.

  • (BETA) Setting "Update SharePoint web parts (Summary Links)  can be used in case that you need to update links in Summary Links Store web part.
  • (BETA) Update SharePoint quick launch links => beta version, sometimes SharePoint is not allowing changes of those links
  • (BETA) Update SharePoint top navigation bar => beta version, sometimes SharePoint is not allowing changes of those links


In case of Misc (all options are exclusive and selecting of any of them will uncheck any other checked option)


  • "Remove Link Sources from Excel docs" ReplaceMagic will remove all link sources from Excel files. After removing external references formulas will be also updated in form => If formula was “=‘SomeExcelFile.xlam’!customfunction()”, after removing the external link “SomeExcelFile.xlam”, this cell’s formula will become “=customfunction()
  • "Break Link Source in Excel docs" will simulate Break Link over Excel => Edit Link => Break Link which is breaking used link so all formulas will be converted into latest shown value:
  • Resave documents - to be used only on ReplaceMagic team request. When selected ReplaceMagic will only resave documents without making any changes.


Additional options are:

  • Save strings:


    When you create list of your search&replace strings you can save them for later usage by providing "Save name" and clicking on "Save strings". All saved strings will appear in "Save strings" drop-down for later selection. Also you can delete previously saved set of search&replace strings by selecting it over "Saved strings" drop-down and then pressing delete button.

  • Convert "Backslash to slash" and "Slash to Backslash" (only for hyperlinks, OLE, link sources, power queries and pivot)- ReplaceMagic can automatically convert slash and backslashes during search and replace process. Good example, if you have files stored on network location links will have format like \\SomeServer\Folder\DocumentName, after moving documents to SharePoint where only server name is replaced (search string \\SomeServer\, replacement string https://company.sharepoint.com/) you will have link like https://company.sharepoint.com/Folder\DocumentName. To avoid this by setting "Convert Backslash to Slash" during replacement process ReplaceMagic will automatically convert all \ in / leading that final link looks like https://company.sharepoint.com/Folder/DocumentName.

  • Create Backup with Extension - we recommend that you backup your documents before processing them. By selecting this option you can set also what extension should be but also specify should backup work only for changed documents. Per default ReplaceMagic will backup all processed documents. Default extension is .RMBackup.

    Important: in case of changes in SharePoint with native connectivity this option does not have any influence as backup is controlled through SharePoint versioning features.

  • Backup only changed documents - to save space ReplaceMagic will make backup only if documents are changed. Basically no change will be saved before backup is not done.
  • Below "Backup only changed documents" you can also specify location where backed-up documents should be saved
  • Change hyperlink address only - each hyperlink consist of TextToDisplay and Hyperlink property. By setting this option ReplaceMagic will only change Hyperlink leaving TextToDisplay unchanged.
  • Backup location - you can specify where you want ReplaceMagic to save backup files
  • Change hyperlink offers option to set that change is made only in Address (Address only) or TextToDisplay (TextToDisplay only) property of hyperlink:



  • Only whole words - by setting this ReplaceMagic will make replacement only if full word is identified. For example, if you have text "ReplaceMagic application is pure magic" and you set this option and as a replacement string enter Magic and speed result will be "ReplaceMagic is pure speed". If this option is not set result will be "Replacespeed is pure speed"
  • MatchCase - will instruct ReplaceMagic to search & replace only strings where case is matching
  • Match wildcards or Use regex - will enable you to set pattern according to which ReplaceMagic will decide to process or skip your documents. For more information about patterns search Internet.
  • Run in 'Replace Preview' mode - will allow you to enter search & replace string(s) and ReplaceMagic will simulate replacement process without changing anything. This will help you create documentation about all changes that you are about to make without actually making them.

    Trial version - In case that you have trial version by selected Replace Preview mode ReplaceMagic will report all changes to be done without saving them. Without this option selected only changes in around 10% of scanned documents will be saved.
  • Save configuration => In case if you want to save set options select this checkbox. All settings except search&replace key pairs will be saved for next time when you open this form. Search&Replace keypairs can be exported over "Export list" and later imported over "Import list"


For example in my found documents I saw that I have hyperlink www.oliver.com which I want to replace with www.replacemagic.com:


graphic


As a search string I'll enter Oliver and as a replacement string ReplaceMagic:



As I want only to make changes in hyperlinks (including TextToDisplay) I am setting for "Search in..." only hyperlinks


If you want to remove some of entered search/replace strings just double click on search string that you want to remove.


After clicking on Ok ReplaceMagic will start replacement process and results will be shown in Search & Replace tab

graphic


Also during replacement run group Processing will change caption to show if you are running in Preview mode (no changes will be saved) or in Execute mode (changes will be saved):




or



From version 4.0.7 you will see summary form if this option is selected over Configuration => Show replacement summary

graphic


In case that you do not use "Scan documents" to scan documents Search&Replace will first scan folders and then start replace process.


If you previously scanned folders then over Search&Replace button you will immediately start replace process.


Additionally you have possibility to import list of search & replace strings by using Import Strings. By starting this option new form will appear




In this form you'll need to find where is you import file and to click on ok. After that Replace Magic will import all found strings. Export/Import words separator is defined over Configuration (option Import Search&Replace separator) but format is something like (in case that separator is |):


FindSomething1|ReplaceWith1

FindSomething2|ReplaceWith2


Each search & replace pair has to be in separated row.


To export list of string click on Export Strings:

 


set where you export location is and give file name.


After import of search&replace string ReplaceMagic will save last used file so next time when you want to import strings again ReplaceMagic will automatically point to last used file.


From ver. 4.6.1 you can save your search&replace strings directly through ReplaceMagic and re-use them afterwards by selected from drop-down:



If you click on "Start Replacement" and you did not set "Suppress Warnings" in Configuration or you did not select "Run in 'Replace Preview' mode" you will be asked are you sure that you want to run replacement:



Sorting of search & replace strings - As sort order of search&replace strings is very import ReplaceMagic will now sort them automatically according to their length descending when you press button to start replacement process or to prepare parameters for command line run. This is required as if you have shorter strings first ReplaceMagic might make changes when shorter string is found and as it is also part of longer search string that might cause that longer string is skipped as changes are already done. This is done in the background to ensure that strings are properly sorted but sort order will not be visible in search and replace form.
As a indicator, we added new column "Search length" which can be used as indicator to show length of your search strings:


Changes of LinkSources in PowerPoint:


In case that Automatic Update in PowerPoint document is not set and new link for external chart does not exist or is not accessible ReplaceMagic will make a change but chart in PowerPoint document will still be the old one. To manually update chart (pull data from new location) will need to right-click on chart and in context menu select option "Edit Data" which will open source Excel file. After Excel is opened chart in PowerPoint document will be automatically updated.
Second option is to click in PowerPoint on File => "Edit Links to Files" and there to select "Automatic Update"