#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11111508 use warnings; open my $fh1, '<', \< ) { /([a-z][a-z_]*), (0x.),?$/ and $values{$1} = $2; } while( <$fh1> ) { s!([a-z][a-z_]*) = \K(\w+)(?=,$)! $values{$1} // $2 !e; print; } #### ibl_ss_fuse_c0_r0/MRA_PVT_Tuning = 0x94, ibl_ss_fuse_c0_r0/S3M_SPARE_1B7_3to7 = 0x0, ON_DIE_FILLER/filler_fuse = 0xa, ON_DIE_FILLER/filler_byte = 0xb,