# use a tagging by neuron-id file and the physical position file
# move tagged neurons to the end of file -> gnuplot ind 0/1
#
ARGIND == 1 {
  n = $1
  $1 = ""
  ++tagged[n]
  save[n] = $0
}

ARGIND == 2 {
  if($NF in tagged)
    stack[$NF] = $0
  else
    print
}

END {
  print ""
  print ""
  for(i in stack) {
    split(i, arr, FS)
    print stack[i], save[arr[1]]
  }
  print ""
  print ""
}
