What have you tried?

I've never had need to parse the output other than with my eyes but it doesn't sound especially difficult. Here is a sample output from my office desktop...

C:\Users\user\Perl>ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : Lets-Delight-Office Primary Dns Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : lan Wireless LAN adapter WiFi 2: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Realtek RTL8192EU Wireless LAN +802.11n USB 2.0 Network Adapter Physical Address. . . . . . . . . : 1C-BF-CE-87-64-C2 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Wireless LAN adapter Local Area Connection* 11: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual +Adapter #3 Physical Address. . . . . . . . . : 1E-BF-CE-87-64-C2 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Wireless LAN adapter Local Area Connection* 12: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual +Adapter #4 Physical Address. . . . . . . . . : 1C-BF-CE-87-64-C2 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Ethernet adapter Ethernet 2: Connection-specific DNS Suffix . : lan Description . . . . . . . . . . . : Intel(R) Ethernet Connection I2 +17-LM Physical Address. . . . . . . . . : 98-90-96-C9-54-D5 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::dbac:863b:bb80:c775%21(Pr +eferred) IPv4 Address. . . . . . . . . . . : 192.168.1.232(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Lease Obtained. . . . . . . . . . : 08 November 2023 10:41:58 Lease Expires . . . . . . . . . . : 08 November 2023 22:41:59 Default Gateway . . . . . . . . . : 192.168.1.1 DHCP Server . . . . . . . . . . . : 192.168.1.1 DHCPv6 IAID . . . . . . . . . . . : 261656726 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-27-A4-98-23-00-19-9 +9-EB-E2-1E DNS Servers . . . . . . . . . . . : 192.168.1.1 NetBIOS over Tcpip. . . . . . . . : Enabled C:\Users\user\Perl>

Splitting each line by ' : ' then removing the full stops from the and of the first part and the line break from the end of the second part and you should be done.


In reply to Re: parsing windows ipconfig /all by Bod
in thread parsing windows ipconfig /all by g_speran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.