Adding Extra Column in txt file base on Condition

HI Guys,

I have below input.

Output Base on Below Condition.

1> if forth column is empty and next coming line have same name with \es then add that column name on all rows
2>rest of all are es:vsDataEUtranCellFDD

Input:-				
CCL01736	CCL01736_7A_1	es:vsDataEUtranCellFDD		
CCL01736	CCL01736_7A_1	es:frameStartOffset		
CCL01736	CCL01736_7A_1	es:subFrameOffset	0	
CCL01736	CCL01736_7A_1	es:timeOffset	0	
CCL01736	CCL01736_7A_1	/es:frameStartOffset		
CCL01736	CCL01736_7A_1	es:systemInformationBlock6		
CCL01736	CCL01736_7A_1	es:tReselectionUtra	2	
CCL01736	CCL01736_7A_1	es:tReselectionUtraSfMedium	100	
CCL01736	CCL01736_7A_1	es:tReselectionUtraSfHigh	100	
CCL01736	CCL01736_7A_1	/es:systemInformationBlock6		
CCL01736	CCL01736_7A_1	es:timeOffset	0	
				
Output:-				
CCL01736	CCL01736_7A_1	es:vsDataEUtranCellFDD	es:vsDataEUtranCellFDD	
CCL01736	CCL01736_7A_1	es:frameStartOffset	es:frameStartOffset	
CCL01736	CCL01736_7A_1	es:frameStartOffset	es:subFrameOffset	0
CCL01736	CCL01736_7A_1	es:frameStartOffset	es:timeOffset	0
CCL01736	CCL01736_7A_1	es:frameStartOffset	/es:frameStartOffset	
CCL01736	CCL01736_7A_1	es:systemInformationBlock6	es:systemInformationBlock6	
CCL01736	CCL01736_7A_1	es:systemInformationBlock6	es:tReselectionUtra	2
CCL01736	CCL01736_7A_1	es:systemInformationBlock6	es:tReselectionUtraSfMedium	100
CCL01736	CCL01736_7A_1	es:systemInformationBlock6	es:tReselectionUtraSfHigh	100
CCL01736	CCL01736_7A_1	es:systemInformationBlock6	/es:systemInformationBlock6	
CCL01736	CCL01736_7A_1	es:vsDataEUtranCellFDD	es:timeOffset	0

Because some data are between two tag so i want that tag name before that data and rest data are under es:vsDataEUtranCellFDD

I do not understand the requirements as stated. I think there is too much data included in this example. I don't see the logic by comparing the input and the output files.

The problem statement isn't clear. The provided data samples are not clear. Perhaps you should try putting a script together of some sort and post what you tried.

1) 4th column, are you using a space or tab delimiter?
2) same name? what part or column is that?

And, what have you tried?

4th column Space delimiter

Between This two Data i want o put that data name in third column
Example :-
es:frameStartOffset
/es:frameStartOffset

es:systemInformationBlock6
/es:systemInformationBlock6