Its as in option 2 that is new line after every string in both A and B.
Also in your code the strings like bin\
5\ , bin \
43\ and bin\
123\ (like array elements with element number in square brackets)are not getting deleted from B. Can you help on this?