Input of the text file

```
A | 1 | def | 1432
A | 1 | ffr | 1234
A | 1 | dfs | 3241
A | 2 | asf | 2213

```

Desired Output 

```
A | 1 | def 1432,ffr 1234,dfs 3241
A | 2 | asf 2213

```

Merging values related to **2nd column** in a single row