krupalibshah
8 years agoContributor
Writing a forEach
Hello,
I have a use case where I am getting my input in tab delimited form, which after doing a groupBy N I am converting to an array so that I can make some comparison operation.
I need to extract the records from this array group for below mentioned conditions,
- All records between a line starting with ‘8’ and value of 5th column as 3 till line starting with ‘9’.
- All records between a line starting with ‘8’ and value of 5th column as 4 till line starting with ‘9’.
- All records between a line starting with ‘8’ and value of 5th column as 5 till line starting with ‘9’.
Wanted to write a forEach to achieve 3 arrays as mentioned above. After getting the 3 arrays I need to check if all value of 3rd col of array1 are present in value of 4th col of array2 and pic only the ones that are present.
For doing all these I wanted to get some help to be able to get the desired output in optimum way.