I'm not familiar with Windows shell. So, let's say my file is like:
DontAppend this line shouldn't be appended
DontAppend this line shouldn't be either
Some lines
more lines
And I'm appending like this:
type file.txt >> AppendHere.txt
This appends the whole file. How do I make it so it skips lines that begin with "DontAppend"?
Either get
grep
for windows or you could use Windows' ownfind
commandThe
/v
option means output lines that dont match your string.find
works for very simple things like this but any more you will need a real filtering tool likegrep
The command findstr will let you search for lines not containing a string or regular expression so you can use:
The /r option says it should use regular expressions and the caret (^) says it should begin with the string.
Edit: added a filter for non alphanumeric chars that may solve the Unicode issues (Unicode files sometimes have a non-printable indicator characters in the beginning).