How to use AWK select the file name in URL? Try this in line no 18. printf "\t\t\t<td><a href=\"%s\">%s.tgz</a></td>\n", r[2], r[1]