powershell字符串处理(1)
★匹配txt的标题,从中取出以w开头的12个字符
Get-ChildItem -Include *.txt -recurse | foreach {$_.Name.SubString($_.Name.IndexOf("w"),12);} | Sort-Object
★匹配txt文本中的内容2000
Select-String -Path *.txt -Pattern 2000
------山的那一边
★匹配txt的标题,从中取出以w开头的12个字符
Get-ChildItem -Include *.txt -recurse | foreach {$_.Name.SubString($_.Name.IndexOf("w"),12);} | Sort-Object
★匹配txt文本中的内容2000
Select-String -Path *.txt -Pattern 2000