You can also type findstr /? at the command prompt and it’ll show you the usage. You can read the reference document here to learn how to use findstr. Both are quite powerful and can find pretty much anything you are looking for. One runs in the normal command prompt and the other uses PowerShell. If you only need to perform a quick search and don’t want to install a full-fledged program, you can use the built-in command line tools in Windows. It can even extract statistics from your log files and give that information to you. I only recommend this program if you have some serious search needs that include finding text in Word files, PDF documents, Excel spreadsheets, etc. It’s a whopping $159! It’s pretty much got all the features mentioned above, plus some more, and all packaged nicely into a pretty little interface. This program has some serious features and a serious price tag to go along with it. If you are looking for the ultimate search program, then look for further than PowerGREP. The pro version costs $25 and seems to just disable the splash screen, otherwise the features are the same. The free version has a splash screen that you can’t disable. It’s pretty fast overall and shows you matches in a tabular format. BareGrepīareGrep is a fairly simple search program that supports regular expressions and all the basic search functions. I also find their interface to be more modern and pleasing to the eye. You can also save or print out all of the results for future reference. grepWin also has that option if you choose the Content radio button, but I think it’s implemented better in AstroGrep.ĪstroGrep can also search Word files, which is a handy feature. Not only does it get updated quite often, it also shows you where in the file the text was found. AstroGrepĪstroGrep is also another really good search program. The results are listed in the bottom window and you can just double-click on them to open the files. It also adds an option to the right-click context menu in Explorer to quickly search a folder. You can limit the search by file size, file type and other criteria. They also have a tutorial on their website to help with regular expressions, though you can Google for many more. It supports regular expressions and allows you to find and replace text also. $subtitlecollection=Get-ChildItem $directory -Filter *.GrepWin is probably the most popular out of the tools mentioned here. ValueFromPipelineByPropertyName = New-Object -TypeName $strmrdr = Select-String -Path $item.FullName -Pattern 'OpenSubtitles' $SrtFiles = Get-ChildItem T:\ -Filter *.srt -Recurse This is a bit more than what grep does and I got it working just as fast as grep!!! Powershell wins the day!! You guys are awesome! Script is below. Took 1s to enumerate all SRT files and filter only files with 'opensubtitles' in the content of the files, storing that filename and content in a collection of custom objects. I got the script to perform as fast as grep. However, should the performance difference be by a factor of 60? Is that normal? Or is my approach in powershell flawed? Yea, grep is run from the server that actually contains the file rather than a network share. Grep returns the list of filenames in terms of milliseconds (less than a second). I've run this several dozen times with an average time of 59 seconds each. Each of these custom objects are contained in a collection that I iterate through searching for the term 'OpenSubtitles' and then print out the file name. Then created a custom PS Object for each SRT file with Name and Content as properties of type string. I constructed a PS script to enumerate all the SRT files in a network location from a Windows Client. Research Triangle Powershell User Group remote-capable.Philadelphia PowerShell User Group remote-capable.Madison Power Users Group remote-capable.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |