This is fine and working
a [1] = "A/A"
How to define some thing like this ???
a [1] = "A/A" or "T/T or some thing else
This is fine and working
a [1] = "A/A"
How to define some thing like this ???
a [1] = "A/A" or "T/T or some thing else
I couldn't understand fully what you're expecting.
Are you expecting like this?
a[1]="A/A" || "B/B" || "C/C"
awk '
BEGIN {
a[1] = "\"A/A\""
a[2] = "\"A/G\""
a[3] = "\"G/G\""
OFS = "\t"
}
NR == FNR {
if (NR == 1) {
for (i = 2; i <= NF; ++i)
s = $i
next
}
for (i = 2; i <= NF; ++i)
++b[s, $i]
next
}
{
$6 = $3
if (FNR == 1) {
$3 = "\"StYPE\""
$4 = "\"Ntype\""
$5 = "\"Stype_No\""
} else {
if ($1 == last) ++i
else { last = $1; i = 1 }
if (i in a) {
$3 = a
$4 = i
$5 = b[$1, a]
} else {
$3 = "\"NULL\""
$5 = $4 = "\"null\""
}
}
}
1
' input1.csv input2.csv
Take a look at bold letters
I want to define them as
a[1] = "\"A/A\"" || "\"T/T\""|| or something else
but they are not working