You have to parse both the files.
If your files are really
so regular then you may just use profitably
fscanf
and
fprintf
for the job.
For instance
if ( fscanf(fp "%c=%d", &name, &value) == 2)
{
}
is a very rough line-parser for second file entries.
If you need to handle more complex scenarios (for instance multiple blanks, longer identifier names) then you may use
awk
or parsing tools tools like
bison & flex
.