procedure tpick (file_name, n, x) string file_name {prompt="Input file containing a stream of words"} real n {prompt="Pick off every nth entry"} real x {prompt="Starting from x"} struct *flist begin string nthWORD struct currentWORD real j # counter real Y real Yint flist = file_name j = 0. while (fscan (flist, currentWORD) != EOF) { j=j+1. Y=((j-x)/n) Yint=(real(int(Y))) # condition for inclusion is that int(Y)==Y if (Yint==Y) { nthWORD=currentWORD print (nthWORD) } } end