I am new to Spark scala world and trying to learn it. I have a variable containing following value.
val result = "Scan value: 1802 seconds
Start time: Thu, Jan 31 2019, 15:09:09 GMT
End time: Thu, Jan 31 2019, 15:39:11 GMT"
I want to read scan value which is 1802 seconds and start time and End Time to different variables.
I am trying to use substring but I am not getting the results properly and the position may very the way the user enters.
For example: To read scan value, I am doing as follows. But some times these position might change based on how user enters in the system.
val scan_value = result.sbstring(13,4)
Could anyone please help me on how to read these values into separate variables in scala.
Thanks, Babu