I have a text file **(applications.txt)** containing n number of lines of data (with 2 delimiters) in the below format. 

1) mytvScreen|mytvScreen|Mi TV,Mí TV, My Tv, TV  

2) watchNextScreen|watchNextScreen|Seguir viendo,Mi TV Seguir viendo  

3) recordingsScreen|recordingsScreen|Grabaciones,Mis Grabaciones,Mi TV 

Note: 1,2,3 are just line numbers for reference. Original file doesn't contain the number.

I am trying to write a function that would read each line and convert it into a dictionary using the value before the first delimiter and the values after the second delimiter, like the example shown below.

eg:

The below line one should be converted into dictionary as expected below.
1) mytvScreen|mytvScreen|Mi TV,Mí TV, My Tv, TV

Expected Format:

mytvScreen : Mi TV, Mí TV, My Tv, TV

Also, Upon giving any value which are comma separated, it should return the value before the colan . 

Eg:

When the value Mi TV is given, it should return mytvScreen or for the other comma separated values also, it should return mytvScreen 

I was able to read the file and print the values as expected. 

But not sure how can i convert each line into a dictionary. 

```
with open('applications.txt') as f:
                for line in f:
                        details=line.split("|",2)
                        print (details[0] + ' : '+ details[2])

```

Your Help is highly appreciated.