```
id1   id2    date

101   NA      01.1.2021     
102   101     12.1.2021
103   102     17.1.2021
104   103     18.1.2021
105   NA      25.1.2021
106   NA      03.1.2021
107   NA      10.1.2021
108   107     11.1.2021
109   NA      09.1.2021 

```

I have two id variables in a data. I need to search for string sequentially.

Search 101 (`id1[1]`) in `id2`, if 101 present in `id2`, then continue and return 102 (`id1`). Again it will search for 102 in `id2` and if 102 present in id2, then continue and return 103. The process will continue and will stop when `id1` is not present in `id2`.

So output will be:

```
[[1]] 01.1.2021, 12.1.2021, 17.1.2021, 18.1.2021

```

Similarly 2nd output for id 107 will be:

```
[[2]] 10.1.2021, 11.1.2021

```