I have a file, that has lines of data with control characters delimeted such as ^B, ^A and so on. I want to parse this data and I want to be able to split the data by the control characters?
split('^B',$data);
doesnt work for me.
How can i split this data by control characters such as ^B or ^A?
If the text has literal control characters, then you’d have to split on those. You’re splitting on a 2-char STRING that happens to LOOK like a control character.
Try
as ctrl-b is ascii 0x02;