Okay, Now I am able to parse space which was my previous problem. Now my parser is almost ready but has a defect which I am unable to figure out.
I am able to retrieve D
Use method Sting.split(). Think about all your delimiters and put they all as an argument to split. Be aware that split works with regex, so special characters like | must be escaped. For example line:
Sting.split()
|
String[] tokens = str.split("[\\s+\\|]");
should create expected tokens from your input.