data = '''
eth 0, address 001, type ethernet
device native, cast established.
em 1, address 002, type ethernet
device native, cast exit
eth 2, address 003, type ethernet
device native, cast rescue0b0
loopback 3, address 003, type ethernet
device native
'''
1st : I need to split the data like:
split0:
eth 0, address 001, type ethernet
device native, cast established.
split1:
em 1, address 002, type ethernet
device native, cast exit
split2:
eth 2, address 003, type ethernet
device native, cast rescue0b0
and so on...
2nd I need to split the data per line so that I can fetch the below details.
split0:1 eth 0,
split0:2 address 001
split0:3 type ethernet
split0:4 device native << new line here...
and continue for all other primary splits as well.
split2: and 3
its not mandatory to have fixed value at the end of each paragraph. The logic here is new interface paragraph always start without a space. I need that logic.
What I have tried:
i have tried multiple things but not getting any repose from python split.