2022-12-06 19:17:13 +00:00
|
|
|
BEGIN { W = 14 }
|
|
|
|
{
|
|
|
|
for (i=1; i<=length($1); i++) {
|
|
|
|
window = substr($1,i,W)
|
2022-12-06 19:21:37 +00:00
|
|
|
# compare each char of the window to rest of the window
|
2022-12-06 19:17:13 +00:00
|
|
|
S = 0 # to count match
|
|
|
|
for (j=1; j<=W; j++) {
|
2022-12-06 19:21:37 +00:00
|
|
|
for (k=j+1; k<=W; k++) {
|
2022-12-06 19:17:13 +00:00
|
|
|
S+= (substr(window,j,1) == substr(window,k,1)) ? 1 : 0
|
|
|
|
}
|
|
|
|
}
|
2022-12-06 19:21:37 +00:00
|
|
|
if (S == 0) {
|
2022-12-06 19:17:13 +00:00
|
|
|
print i + W - 1
|
2022-12-06 19:21:37 +00:00
|
|
|
next
|
2022-12-06 19:17:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|