You need to properly escape the separator if it occurs inside data strings. E.g. if the data string includes "|", replace it with a different character. Then of course you have the problem that if the replaced character appears, you have to replace that with something else.
If you just use a standard format like JSON that already supports all of this so you don't have to worry about it. It's why you should use existing data formats instead of inventing your own, and then having to solve all the same problems data formats have to solve.