What is the best way to extract each field from each line where there is no clear separator (deliminator) between each field?
Here is a sample of the lines I need to extract its fields:
3/3/2010 11:00:46 AM BASEMENT-IN
3/3/2010 11:04:04 AM 2, YaserAlNaqeb BASEMENT-OUT
3/3/2010 11:04:06 AM BASEMENT-IN
3/3/2010 11:04:18 AM BASEMENT-IN
3/3/2010 11:14:32 AM 4, Dhileep BASEMENT-OUT
3/3/2010 11:14:34 AM BASEMENT-IN
3/3/2010 11:14:41 AM BASEMENT-IN
3/3/2010 11:15:33 AM 4, Dhileep BASEMENT-IN
3/3/2010 11:15:42 AM BASEMENT-IN
3/3/2010 11:15:42 AM BASEMENT-IN
3/3/2010 11:30:22 AM 34, KumarRaju BASEMENT-IN
3/3/2010 11:31:28 AM 39, Eldrin BASEMENT-OUT
3/3/2010 11:31:31 AM BASEMENT-IN
3/3/2010 11:31:39 AM BASEMENT-IN
3/3/2010 11:32:38 AM 39, Eldrin BASEMENT-IN
3/3/2010 11:32:47 AM BASEMENT-IN
3/3/2010 11:32:47 AM BASEMENT-IN
3/3/2010 11:33:26 AM 34, KumarRaju BASEMENT-OUT
3/3/2010 11:33:28 AM BASEMENT-IN
There are 6 fields in each line and some of them can be empty. What is the best way to approach this problem?
- I'm using Java
Edition 01
- Field 5 can be empty (however its existence should be recognized in all cases)
- Amount of spaces can change
- Last word can change