I trying to take values from a file and use those values to replace a value in other files.

Data file looks something like this


The number of files I need to replace a value in is the same as the length of the data file

This is an example 1st file in the directory
the value I need lies somewhere in the file
The previous line is where I need to replace the 1 with the first value in the data file
the only way I can see this working is to read in the files in the same order as the the values appear in the data file
which is easy to do but I can't seem to find a way to pipe the 1st line of the data file into a gsub type function

Thanks for any help you can provide.