I know it's 'sexy' to do this sort of thing
lCrd.append(line,1,line.find("Y")-1);
but the issue with it is, if
line.find("Y")-1
doesnt evaluate 'nicely' or is out of range, its hard to spot/correct, even using a debugger.
I would start by 'coding defensively', even 'basic/gumby style' so you could do somethling like
int foundpos = line.find("Y")-1;
assert (foundpos < 0)
assert (foundpos > line.length())
(thats just a rough idea btw, you could use an 'if' .. the point is, you then get a chance to test the string positions && handle unexpected values .. either that, or start using 'try/catch', and/or have a different way of sanitising your strings before you get to this point)
... so you know what Im going to say about
lCrd.append(line,line.find("Y"),line.find("Z")-line.find("Y"));
dont you :-)
'g'