VMware Cloud Community
jediller
Contributor
Contributor

EOL format in commands

I need to parse data, which just got a lot when I found the esxcli --formatter=keyvalue,

which for example gives me data like this.

The data I treat as a String

Question: Can I always assume each line is terminated by a single '\n'   (0x0A) ?

If not, what usable can I use to separate the lines when I parse the data?

esxcli --formatter=keyvalue network ip interface ipv4 get

structure[0].IPv4Interface.AddressType.string=STATIC

structure[0].IPv4Interface.DHCPDNS.boolean=false

structure[0].IPv4Interface.Gateway.string=10.243.0.1

structure[0].IPv4Interface.IPv4Address.string=10.243.1.43

structure[0].IPv4Interface.IPv4Broadcast.string=10.243.15.255

structure[0].IPv4Interface.IPv4Netmask.string=255.255.240.0

structure[0].IPv4Interface.Name.string=vmk0

structure[1].IPv4Interface.AddressType.string=DHCP

Reply
0 Kudos
0 Replies