Well, since it is obvious that besides powershell there is no standard tool for windows that does this, you can roll:
#include <stdio.h> #include <string.h> main(int argc, char *argv[]) { char s[2048], *pos=0; while (fgets(s, 2048, stdin)) { if (pos = strpbrk(s, ":\r\n")) *pos='\0'; puts(s); } return 0; }
Note that this has a βside effectβ of line end normalization (CRLF) and does not allow lines> 2048 characters per input. However, it works equally well on all platforms, and I just compiled it using wingcc (winelib), mingw (on linux), and the MSVC compiler. If you want a binary, let me know
Oh, mandatory demonstration of use:
C:\> strip.exe < input.txt > output.txt
source share