I have experienced this issue with Soliworks equations since 2015 and I figured it was time to post this issue as there has been no solutions on Solidworks end.
I cannot add new equations to an exported equations.txt file (without unnecessary shenanigans). Regardless of my formatting, adding new equations to a .txt file corrupts the global variables. In the example below I have a part with 4 global variables "test"-"test4". Once I exported the .txt document I added the new global variable "test5" with the correct formatting and now the global variable is combined with "test4" once I re-import the equations.
Now I can open the .txt file up in word then then save it which seems to solve the issue sometimes. Or you can add the new equations manually into Solidworks, re-export the equations and save over the corrupted .txt file which is what I have been doing. Does anyone have any idea of what is causing this issue? Solving this issue could save hundreds of hours for a design engineer using equations for large assemblies.