Assign multiple materials to multiple sub levels

I have large terrain created with world composition, about 800 sub-levels.
I also have the same number of materials (raster) so each tile (sub level) has it own material.
For example:

tile_x0_y0 raster_x0_y0
tile_x0_y1 raster_x0_y1
etc.

Im trying to assign these materials to their matching sub-level via blueprint/blutility or c++, in editor mode.
Let assume that all sub levels are loaded…
For now, the way I found is only do it manullay which is not really possible…

thanks