An .exe file within a loop returns a string a need to convert (efficiently) to a data table.
The string has the following characteristics:
- Rows are limited by "\n" characters, although this can be changed if needed
- Columns are limited by ","
- The begging and the end of the string has rows one needs to eliminate
- The datetime rows can vary. In the example one can see 7 but these can go up to 100k rows.
- This operations will be repeated within the loop in the order of hundreds (different strings but same number of rows)
str_query =
"*> mycolumnname
1,mycolumnname,50.,mycolumdescription,mycolumnunits
* End exe...
*> mycolumnname, 31-Jan-2020 14:30:00, 31-Jan-2020 15:30:00, blabla, 7
31-Jan-20 14:30:00,mycolumnname,10.60466
31-Jan-20 14:40:00,mycolumnname,10.60466
31-Jan-20 14:50:00,mycolumnname,10.60466
31-Jan-20 15:00:00,mycolumnname,10.60466
31-Jan-20 15:10:00,mycolumnname,10.60466
31-Jan-20 15:20:00,mycolumnname,10.60466
31-Jan-20 15:30:00,mycolumnname,10.60466
* End exe...
...
...
...
...
";
How can I transform this string into a data table with the following (stacked) format:
31-Jan-20 14:30:00,mycolumnname,10.60466,mycolumdescription,mycolumnunits
31-Jan-20 14:40:00,mycolumnname,10.60466,mycolumdescription,mycolumnunits
31-Jan-20 14:50:00,mycolumnname,10.60466,mycolumdescription,mycolumnunits
31-Jan-20 15:00:00,mycolumnname,10.60466,mycolumdescription,mycolumnunits
31-Jan-20 15:10:00,mycolumnname,10.60466,mycolumdescription,mycolumnunits
31-Jan-20 15:20:00,mycolumnname,10.60466,mycolumdescription,mycolumnunits
31-Jan-20 15:30:00,mycolumnname,10.60466,mycolumdescription,mycolumnunits
Which JSL functions can manage these string to data table operations efficiently (memory and/or CPU wise?).
Multi-threading or multiprocessing cannot be used this is querying a database.