I like to know how to split a string on the basis of delimeters : I have a csv file which comprises of 5 columns of which i need only two columns which are seperated by pipe(|) delimeter.Here are few of them---

SERIAL_NO|N|1385,45,871,104|1|?

CUST_ID|N|1704,211,552,71|1|?

PROD_TYPE|A|367,286,1167,74|1|?

BRANCH_CODE|N|1892,429,254,74|1|?

BRANCH_NAME|A|682,412,774,72|1|?

DATE|N|2022,581,241,82-1863,581,137,75-1697,581,153,85|1|?

I want just the 0th and 2nd index data in a list so that i can feed that data to a image on the basis of given coordinates i am going to do cropping in image and save those images with file name same as the 0th index data.

In order to make it more clear here is what i want to do i have a image whose coordinates are in csv file(like this 1385,45,871,104)and after cropping on the basis of given coordinates i want to save file with the name of 0th index data of that row which is(SERIAL_NO).i have to do that for all the rows and some rows have more than one coordinates which was divided by - symbol.

So anybody who have idea how to do this kindly help i will be thankful to you.