You can create a new buffer with :new , read the file :r <filename> , upload the entire file for the register (say x) with gg"xyG" and delete the buffer with :q! . If you intend to perform these actions several times, you can create a mapping for it.
To do the same with strings that match the pattern, you can form a global command ( :h :g ) before making a copy to the register.
source share