My txt file looks something like this:
Branch: ltm_7.4
Destination: Test 5
Expand|Select|Wrap|Line Numbers
- lines = open("branch_dest.txt").readlines()
- lines=[x.split() for x in lines]
- print lines
- branch = "%s" % lines[0][1].strip(': ')
- print branch
- destination = "%s" % lines[1][2].strip(': ')
- print destination
[['Branch:', 'ltm_7.4'], ['Destination:', 'Test', '5']]
ltm_7.4
5
Branch is ok. But the destination needs to be Test 5. Kindly help as i am new to Python.