grepWin
grepWin copied to clipboard
output result to console/file
Is there any way to output the result to the console or a file without showing the dialog?
indeed, I don't see any command-line params at https://tools.stefankueng.com/grepWin_cmd.html to save a file with the results.
Would expect: a) file output b) clipboard output c) console output options (maybe even all at the same time)
ideally should have params to
- save all (as copy context menu action does [OR DOESN'T - SEE NEWER COMMENT] if you first press CTRL+A to select all)
- save same as "Copy paths to clipboard"
- save same as "Copy filenames to clipboard"
- save same as "Copy text results to clipboard" some of params 2,3,4 could be combined if 1 isn't given by the user. Obviously if 1 is given they're practically ignored. Could also have the 2,3,4 params as +/- switches so one could give param 1 (all) and then say use param 3 with a minus/off flag to not export the filenames in those results (at all targets given)
could combine with param to close window automatically and/or not show it at all (if possible) or at least have it open minimized and then close again
actually it seems copy action is for copying the file (Windows Explorer related)
I remember there was an option to copy everything (all columns) but now I can't find it anymore, just find 2-3-4 options on the context menu if I select all at the results list
there's also a > button at bottom right but seems to save (and open file after that) a text file (would be nice if it was appending .txt btw to it) with only the filenames column. Doesn't seem configurable at settings what it exports
I remember there was an option to copy everything...
probably I was mixing that with what Git Log has on popup (the Full Data option), not sure if it ever existed here
Doesn't seem configurable at settings what it exports
Thanks for the tip, hadn't noticed the export dialog had those options - if it remembers them (haven't tried) it's similar effect to having config options for those. So one could at least configure them visually and then have some way to export results without showing the UI (from the command-line). Ideally though options should be at either config file or as parameters
I need the console/file output to send a scheduled email with the search result.
I just wanted to use grepWin for quick searches in a tool chain in the console/batch programming. I was surprised that it is not possible to store file paths of the search result, or to output them to the console, without having to interact with a GUI. This would make grepWin much more versatile!
I do think having a bit more of a structured output for saving the search results would be a nice improvement. Saving the output as more conventionally correct CSV (correctly quoted and escaped where necessary, includes headers, etc.) so that it could be opened with Google Sheets or Excel to further manipulate would be nice. The current export is usable, but it's a very bare-bones dump of the gridview. Sure, it's really similar to grep's output, but asterisk-delimited instead of colon-delimited, but I'm not sure if that's really all that usable. I'd rather have the option of a standard Grep format (colon-delimited) and CSV.
That said, I think people are kind of asking for some features in the wrong place. grepWin is primarily targeted as a GUI interface for ad hoc searching. If you need something repeatable or to manipulate it from the command line, you should be looking at actual grep
(it's available for Windows) or Powershell's Select-String
or even ye olde findstr.exe
or similar. GrepWin is a great tool that I use daily, but it's not the only tool that does this task. Existing command line and scripting options are going to have very robust command line features that will meet your needs better than the subset of features that grepWin might choose to add.
I think people are kind of asking for some features in the wrong place.
Essentially, you're right. The fact, though, that grepWin offers a command line interface is a bit misleading in this regard.
Thanks for pointing out alternatives! Didn't know there is a command line grep available for Windows.
I achieved what I wanted to do 2 weeks ago by using findstr.exe
.