To pipe the contents of the clipboard to another command (e.g. grep):
paste | grep pattern
To save the contents of the clipboard to a file:
paste > file.txt
You can compile paste.cs with a single command on any Windows machine without the need to install any extra tools. Just run this command:
%SystemRoot%\Microsoft.NET\Framework\v3.5\csc /o paste.cs
Prebuild version is included here as paste.zip
Put the resulting paste.exe
in your path.
Noticed a caveat with this method, that it doesn't support unicode characters. E.g. copying "Конвертация текста в таблицу" and running
print
resulting in "??????????? ?????? ? ???????".What helped is to specify UTF8 encoding explicitly.
PS Thanks for providing a note about how easy it is it compile it myself, was meeting this encoding issue for a while now, but was hesitant to figure how can I recompile it, turned out it was so simple.
Update. Admittedly, it can also be fixed by specifying
chcp 65001
in the console explicitly.Probably the best solution all together is just enable UTF-8 in Windows by default: