I'm using string for the reason you're showing with your example. I think the question about using array or string is: how is anchors.dat structured?
Let's suppose:
ip_port is 7f0000013e01 and the file content is:
fabfb5da02fc5a030000e1f505000000000000000000000000000000000000ffff7f0000013e01fc5a030000e1f505000000000000000000000000000000000000ffff7f0000013e0075f7d7cf33e71e42f8add50c305f091fb881b6fa5633932559d86cd9f6141260
but we have:
fabfb5da02fc5a030000e1f505000000000000000000000000000000000000ffff7f00 (breaks line)
00013e01fc5a030000e1f505000000000000000000000000000000000000ffff7f000 (breaks line)
0013e0075f7d7cf33e71e42f8add50c305f091fb881b6fa5633932559d86cd9f6141260 (breaks line)
in this case, my logic using string would be useful.
But how is the file structure for this case?
Anyway, almost 100% of my tests showed me that anchors.dat usually has just one line.