in reply to Extracting text from a line

In Unix/Linux,

perl -ne 'print $1 if /^UID:\s*(\w+)/' fileRead > fileWrite


~suhail