What I would like to do is search for lines where the first column does not begin with 'rs' or 'chr' THEN if those lines begin with a number, append 'chr' to the first column value, otherwise leave as it was - no appending.
I have the following code:
awk '((!($1 ~ /rs/ || $1 ~ /chr/)) && $1 ~ /^[[:0-9:]]|$/) {$1 = "chr"$1}1' filename > newfilename
This is good but appends 'chr' to all first column values that do not begin with 'rs' or 'chr'. There are some values in this column that I do not want to change and these all begin with letters (a-z). I only want to change the values which start with numbers (0-9).
Thanks!