How to extract data from a text file using a batch file?

June 3, 2012 at 01:05:58
Specs: Windows 7
Long story short I've previously created a batch file that references a text file, which then proceeds to run nslookup. It does this at certain intervals, but now I have an insanely large text file. I would like to create another batch file to extract from the large text file only the name and IP address of each workstation and then creates another text file in which it will place that information.

See More: How to extract data from a text file using a batch file?

Report •


#1
June 3, 2012 at 11:56:56
This sounds like a process you could boil down in PowerShell.
Get-Content "serverList.txt" | ForEach-Object {
  $_ + " -> " + [System.Net.Dns]::GetHostEntry($_).AddressList[0].IPAddressToString
}

How To Ask Questions The Smart Way


Report •
Related Solutions


Ask Question