The string is unstructured, still you can try doing some string manipulations:-
First of all, splitting the string by Newline
Take the length of the array(6), and assign (length-1) index as the total value.
Further, you can check whether string ends with numeric
If Yes, then take the last 13 characters(2.7750 824.18, 44.0000 44.00, 24.0000 24.00) of those lines(Here we will get 3 lines as last line(total value also ends with numeric but we will replace in the string with blank),
Furher, split them(13 characters) by space and check if It contains 0 after decimal, then just replace it with blank value.
Now you got, Unit & Cost
if No,assign that value to descrption,(0 - (Base, Trim) : Translucent Graphite , Stainless
Now, We have to manipulate remaining data:----
- 297 13424 h2go bfree Fusion Sport Bottle - 23 oz.
1 Set-Up Charge Set-Up Charge
1 *Prepro Proof Charge Prepro Proof per Color
Start splitting with space and get only 2 elements(i.e. 297 & Remaining string, 1 & Remaining Striing, ! & Remaining String), and assign zeroth index as Qty,
Now we are left with description…
Now take the Remaining String, and:-
You can try doing some substring operations.
I hope this helps.