Hi, i have an issue regarding selecting a value from an array.
This is the sample of the txt file;
“***222222” “TA” “N2” “Office” “ahahah@hahah.com.au” “22 Haha Rd or PO BOX 22” “Cardiff” “Ha” “2222” “02 2222 9220” “02 2222 6266” “”
I have managed to extract and put the text into an array with the following javascript
a = data.extract(5,152,0,1,“
”);
var myRegexp =/“([^”]*)"/gi;
var myArray = ;
do {
//Each call to exec returns the next regex match as an array
var match = myRegexp.exec(a);
if (match != null)
{
//Index 1 in the array is the captured group if it exists
//Index 0 is the matched text, which we use if no captured group exists
myArray.push(match[1] ? match[1] : match[0]);
}
} while (match != null);
The following output is ;
[“2222”, “T”, “N1”, “2222 Office”, “2222@mmem.com.au”, “22222 Rd or PO BOX 22”, “2222”, “2222”, “2285”, “02 2222 9720”, “02 2222 6266”];
Please dont mind the difference in output data as I had to change the values from the original data.
My question is I want to use the first element of the array for a specific data extraction field,
And so on and so on for each respective data extraction such as
Field1 = myArray[0];
Field2 = myArray[1];
Currently The javascript works and the output field is
11.0 which is the total number of elements in the array.
How do i extract a targeted element for the data field.?