ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

delete all the lines that do NOT start with a specific string in multiple files

<< < (3/4) > >>

David1904:
TextHarvest is useful for keeping or deleting lines from text files. It is very simple to use.
You can find it on Tucows or other download sites.

TheQwerty:
I believe since Windows NT there's been a command, findstr, which acts similar to grep, but I'm not sure about the support for Unicode.

You should be able to do something like this:

--- ---findstr /V "^needle" input.txt>output.txtThe /V tells it to print the lines that do not match the regular expression "^needle" (any line beginning with "needle").

bgd77:
I've tried it and searched some forums. findstr does not support unicode.  :down:

So, find must be used, and it seems to be really complicated to use it for this purpose.

bgd77:
I think that this can be easily done with Windows Power Shell. Does anyone know more things about it?

app103:
Could probably do it with WSH and javascript too.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version