文檔怎么做 powershell如何讀txt文檔?
powershell如何讀txt文檔?例如,文本內(nèi)容:[IP配置]1 192.168.1.99 56次2 192.168.3.99 55次3 192.168.1.49 54次4 192.168.1.2
powershell如何讀txt文檔?
例如,文本內(nèi)容:[IP配置]1 192.168.1.99 56次2 192.168.3.99 55次3 192.168.1.49 54次4 192.168.1.23 53次5 192.168.2.10 52次[url配置]1索引.html56次2%上傳a.jpg 55次3默認.asp54次4imagesb.jpb 53次5imgc.bmp 52次僅取前3次行$s=GC“E:1.txt”$ip=[array]::IndexOf($s,“[ip Config]”)$url=[array]::IndexOf($s,“[url Config]”)$s[($ip 1)…($ip 3)];輸出文件E:ip.txt文件$s[($url 1)…($url 3)]|輸出文件e:%url.txt文件