How to extract required data from text file which has duplicate values?

First you need split each part (1,2,…)using split method and indexof() method after that apply regex to fetch value.