Quote Originally Posted by Mightymax View Post
&CH1; is the entity placeholder and Bld1_Ch1.sgm is the file with the contents I want to copy in the master.

You could use a regex search to find all the matches for the entity placeholders in the master file.

You can use the same regex search to capture the entity digits, and use those digits to build the name of the file that corresponds to the entity place holder (i.e. &CH1; uses file Bld1_Ch1.sgm, and &CH63; uses file Bld1_Ch63.sgm, and so on).

Then create a StringBuilder from the contents of the master file.Loop through the regex matches that were found and use the StringBuilder's Replace method to replace each of the regex matches (i.e. the &CH###; entities) with the contents of the corresponding Bld1_Ch###.sgm file.