Single parameter range from repeated range values
1 view (last 30 days)
Show older comments
I have an HTML file, in which the parameters of interest occur between square brackets [ ], but then this range keeps repeating with identical names inside subsequent square brackets like this :
var jArray= {"2":["<span style='color:#c7b699'><b>May 1<\/b><\/span>","Percentage: <span>57%\n<\/span>","Interest Rate: <span>0.53","Amount Exchange: <span>150,<\/span>777,<\/span>695.16","Monthly Exchange: <span>370,<\/span>352.08","Interest Differentiation: <span>8.07","Interest RatePer: <span>0.54","Second Quarter","<b>Friday, May 1, 2020<\/b>","May","Phase: <span>Second Quarter<\/span>","May 1"],"0":["<b>April 29<\/b>","36%\n","Interest Rate: 0.52922522949925","Amount Exchange: 150701713.86852","Monthly Exchange: 378921.00811486","Interest Differentiation: 6.0176806272646","Interest RatePer: 0.52559281178633","Quarter Pre","April 29"],"1":["<b>April 30<\/b>","46%\n","Interest Rate: 0.52909124921306","Amount Exchange: 150739875.63889","Monthly Exchange: 374391.59013105","Interest Differentiation: 7.028645917145","Interest RatePer: 0.53195147367036","Quarter Pre","April 30"],"3":["<b>May 2<\/b>","68%\n","Interest Rate: 0.52882712965299","Amount Exchange: 150815161.77193","Monthly Exchange: 367050.8265867","Interest Differentiation: 9.1346986834112","Interest RatePer: 0.54259013649969","Second Quarter","May 2"],"4":["<b>May 3<\/b>","78%\n","Interest Rate: 0.52869706105934","Amount Exchange: 150852264.90232","Monthly Exchange: 364701.85696453","Interest Differentiation: 10.23252765695","Interest RatePer: 0.54608484792928","Second Quarter","May 3"]};
The parameters of interest are the first occurences of 'Percentage', 'Interest Rate', ... 'Date'. inside the first square bracket [ ]. How to export only the contents of the first square bracket out into a separate text file while ignoring all the remaining entries inside subsequent square brackets ? Also, the 'Amount Exchange' is actually 150777695.16 and the 'Monthly Exchange' is 370352.08.
The entry inside the curly brackets { } does not have a new-line character.
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!