Function to match file