Write a script to remove multiple nested array

Mehar Naaz1
Tera Contributor

We have a requirement in crisis map, where we have Feed table{sn_fam_feed} in that we have Impacted Area field to fetch latitude and longitude of data of multiple location which are impacted.

We have coordinates value with Multiple square brackets in between.

MeharNaaz1_0-1720674866995.png

 

We want in this below format :

[[-85.1481213, 47.8240426], [-84.86081714, 47.89571687], [-84.24016987, 48.09787624], [-85.22199953, 48.28969123], [-86.09313426, 48.74553275], [-86.26650076, 48.580811], [-86.27593372, 48.57558458], [-86.28399277, 48.57457584], [-86.53093286, 48.29845467], [-86.13455479, 47.46541826], [-85.80906422, 47.30949464], [-84.91340571, 47.234691], [-85.1481213, 47.8240426]]

 

Can anyone help me with the script ? 

 

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, unfortunately the partial screenshot fails to clarify the format of the data involved.

Is it a string representing nested arrays, an object containing nested arrays, or just an array of nested arrays?
Perhaps you could share details of the data type\format so that the community can better understand and assist