Altova XMLSpy 2024 Enterprise Edition

The Find in Files command is a powerful way to find and replace text quickly among a large number of files. Clicking the command pops up the Find in Files dialog (screenshot below). The Find in Files command is different from the Find command in that it searches all the specified locations for the Find string at once and executes replace actions immediately. A report is then displayed in the Find in Files window. In the case of the Find command, however, the user enters the search string and goes through the (single) active document one found item at a time.

FindInFiles

 

Find criteria

There are two broad find criteria: (i) what to find, and (ii) where to look? For a description of how to set the text that is to be searched (what to find), see the description of the Find command. If the text entered in the Find What text box is a regular expression, then the Regular Expression check box must be checked. An entry helper for regular expressions can be accessed by clicking the Unfold button to the right of the Find What input box (the button marked >) button. The use of regular expressions for searching is explained in the section about the Find command.

 

To specify what node types and parts of an XML document should be searched, check the Advanced XML Search check box and then select the required node types.

 

You can specify where to search: (i) in a Project; (ii) in the files currently open in XMLSpy; (iii) in a project; or  (iv) in a folder. When a project folder is selected, external folders added to the project can be skipped. The files to be searched can be filtered by file extension and a star (xml* or xsl*, for example). The separator between two file extensions can be a comma or a semi-colon (xml*;xsl*, for example). The star character can also be used as a wildcard.

 

The instances of the Find string at all the search locations are listed in the Find in Files window. Clicking on one of the listed items opens that file in Text View and highlights the item.

 

Replace

The most important thing to note is that clicking the Replace button replaces all the instances of the Find string with the Replace string. If Open Files On Replacing was checked in the Find in Files dialog, then the file will be opened in Text View; otherwise the replacement is done silently. All the replaced strings are listed in the Find in Files window. Clicking on one of the listed items opens that file in Text View and highlights the item.

 

Note: Regular expressions are not supported in the Replace field.

 

© 2018-2024 Altova GmbH