troubleshooting Question

Best language to learn to process text files in a Windows enviornment

Avatar of sfjacobs
sfjacobs asked on
Windows OSScripting LanguagesVB Script
4 Comments1 Solution296 ViewsLast Modified:
I'm could use some advice on which programming or scripting language I should learn to be able to "clean up" text output.  I frequently run scripts or batch commands that output a text file that needs to be "massaged" before its useful.   For many years I've just gone through the output and cleaned things up manually, but now I'm working for a company that has nearly a thousand computers so doing it manually is no longer feasible and I need to bite the bullet and learn something that can clean up text output.

Here's an example.  I have a script named ListNICConfig.wsf that collects network interface info from a group of computers and outputs it like so:


*** START OF OUTPUT ***
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

computer, Caption, DHCP enabled, DNS domain, DNS hostname, MAC address
DC:[00000001] Realtek RTL8139 Family PCI Fast Ethernet NIC,False,,dc,00:40:F4:4E:59:05
DC:[00000002] 1394 Net Adapter,True,,,22:82:FD:51:E0:17
DC:[00000003] RAS Async Adapter,False,,,
DC:[00000004] WAN Miniport (L2TP),False,,,
DC:[00000005] WAN Miniport (PPTP),False,,,50:50:54:50:30:30
DC:[00000006] WAN Miniport (PPPOE),False,,,33:50:6F:45:30:30
DC:[00000007] Direct Parallel,False,,,
DC:[00000008] WAN Miniport (IP),False,,,
PARENTS:[00000001] Realtek RTL8139/810x Family Fast Ethernet NIC,True,jacobsfam.local,parents,00:11:2F:9A:22:55
PARENTS:[00000002] RAS Async Adapter,False,,,
PARENTS:[00000003] Packet Scheduler Miniport,False,,,00:11:2F:9A:22:55
PARENTS:[00000004] WAN Miniport (L2TP),False,,,
PARENTS:[00000005] WAN Miniport (PPTP),False,,,50:50:54:50:30:30
PARENTS:[00000006] WAN Miniport (PPPOE),False,,,33:50:6F:45:30:30
PARENTS:[00000007] Direct Parallel,False,,,
PARENTS:[00000008] WAN Miniport (IP),False,,,
PARENTS:[00000009] Packet Scheduler Miniport,False,,,16:CF:20:52:41:53
PARENTS:[00000010] WAN Miniport (ATW),False,,,00:03:8A:00:00:15
WASHINGTON:[00000001] SiS 900-Based PCI Fast Ethernet Adapter,True,jacobsfam.local,washington,00:0C:6E:A8:40:27
WASHINGTON:[00000002] RAS Async Adapter,False,,,
WASHINGTON:[00000003] Packet Scheduler Miniport,False,,,00:0C:6E:A8:40:27
WASHINGTON:[00000004] WAN Miniport (L2TP),False,,,
WASHINGTON:[00000005] WAN Miniport (PPTP),False,,,50:50:54:50:30:30
WASHINGTON:[00000006] WAN Miniport (PPPOE),False,,,33:50:6F:45:30:30
WASHINGTON:[00000007] Direct Parallel,False,,,
WASHINGTON:[00000008] WAN Miniport (IP),False,,,
WASHINGTON:[00000009] Packet Scheduler Miniport,False,,,42:45:20:52:41:53
WASHINGTON:[00000010] WAN Miniport (ATW),False,,,00:03:8A:00:00:15
WASHINGTON:[00000011] Microsoft TV/Video Connection,True,,,
Command completed.

***END OF OUTPUT ***

The output above isn't ready for input into a spreadsheet.  To do that I have to manually process the file to create something like this:

*** START OF CLEANED UP OUTPUT ***
computer, Caption, DHCP enabled, DNS domain, DNS hostname, MAC address
DC:[00000001] Realtek RTL8139 Family PCI Fast Ethernet NIC,False,,dc,00:40:F4:4E:59:05
PARENTS:[00000001] Realtek RTL8139/810x Family Fast Ethernet NIC,True,jacobsfam.local,parents,00:11:2F:9A:22:55
WASHINGTON:[00000001] SiS 900-Based PCI Fast Ethernet Adapter,True,jacobsfam.local,washington,00:0C:6E:A8:40:27

*** END OF CLEANED UP OUTPUT ***

We're 80% a Windows shop, with about 10% Macs and 10% linux machines.   What language would it make most sense to learn?

Thanks!

Seth


Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros