in reply to onle liner help needed

I may have misunderstood the task, but perl -ne 'print if (/030318520070817083011/ ... /\*\*\*.*UID/);' FILE seems about right.