Dumping row with found text (windows)
by - Thursday, January 1, 1970 at 12:00 AM
Just curious if anyone has powershell or cmd scripts to dump a row based on a keyword, like a username? This would be preferable. I have a bat file that usually works but it says strings too long

Also do you know any external windows apps that can do it a lot faster. Preferably open source or very common
Reply
I guess you are looking for 'findstr' in cmd or 'Select-String' in powershell
Reply
The Bat file I use has this command and still says 'strings too long'
Reply
Those commands max out when strings params exceed 254 bytes long. You probably have lines/fields that extend past that limit. Write your own functionality via other means, or break up the file.
Reply
cant help you with your windows based request with a native shell feature,
but "grep" is since decades the standard in the unix world.
there are ports for windows, Im not too sure how good they are, but you may simply try some VM or get yourself like ANY linux distro as live usb version or install it parallel.
You may thank me later, despite indexing I know nothing faster than grep.
Reply
https://github.com/BurntSushi/ripgrep is good
Reply
This PowerShell command worked without the error              
Get-Content mylogfile.txt | Where-Object { $_.Contains("[email protected]") }


Thanks for the grep suggestion tho, will give it a try. And what would be an example of indexing?
Reply
(September 30, 2022, 07:37 AM)Russel_Snake Wrote: I guess you are looking for 'findstr' in cmd or 'Select-String' in powershell
(October 4, 2022, 06:55 AM)pure654783 Wrote: https://github.com/BurntSushi/ripgrep is good


thank you so much for this, tested it out and it's a whole lot faster than the default win tools
Reply


 Users viewing this thread: Dumping row with found text (windows): No users currently viewing.