The veiled guise of binary and string
42

#define LINE_BUFFER 42


42 is not a buffer. Besides being a meaning of life, the universe, and everything, it is size. Consider renaming it to LINE_BUFFER_LENGTH.
No naked loops

Every loop represents some algorithm, and therefore deservers a name. Consider

while (fgets(line, LINE_BUFFER, file)) {
    char * mask = find_separator(line);
    *mask++ = '\0';
    convert_word_according_to_mask(line, mask);
    printf("%s\n", line);
}

Errors (like fopen returning NULL) are better handled with perror() or strerror(errno). Both functions precisely describe what went wrong.