I am faced with a file that has the following structure:
var file = "a|b|c|d, a|b|c|d, a|b|c|d, a|b|c|d, a|b|c|;d";
My goal is to extract all instances of letters "c" and "d" from this file and store them in an array structured like this:
var array = [
[a,b,1],
[a,b,2],
[a,b,3],
[a,b,4],
[a,b,5]
];
Is it possible to achieve this? If so, how?
--------------EDIT----------------------
What if I have an array structured like this?
exArray = [
["a":"one", "b":"two", "c":"three", "d":"four"],
["a":"five", "b":"six", "c":"seven", "d":"eight"]
];
The resulting array should be:
var array = [
[two,three,1],
[six,seven,2]
];