my %data = map {s/\.\d+//g; /(.+)\s+\|\s+(.+)/ and $1 => $2 } grep /\S/, read_file $test2;