{"id":51,"date":"2017-12-10T15:54:30","date_gmt":"2017-12-10T15:54:30","guid":{"rendered":""},"modified":"2023-12-27T13:36:32","modified_gmt":"2023-12-27T18:36:32","slug":"clp-command-line-text-file-list-program","status":"publish","type":"post","link":"https:\/\/exeyesoftware.com\/index.php\/2017\/12\/10\/clp-command-line-text-file-list-program\/","title":{"rendered":"CLP &#8211; Command Line Text File List Program"},"content":{"rendered":"<p>I&#8217;ve decided to post some of the useful small programs I&#8217;ve written for my own use.<\/p>\n<p><strong>CLP<\/strong> is a simple C# console program that lists text files on a Windows printer. It was originally intended to list C source code, but it is useful for printing many kinds of text files. Yes you can use <strong>Notepad<\/strong> for this but <strong>CLP<\/strong> has some useful differences and additional features:<\/p>\n<p>1. As a command line program that takes a filename as an argument, you can put it in your <strong>SendTo<\/strong> list and thus be able to print text files from a right-click.<\/p>\n<p>2. <strong>CLP<\/strong> puts a header in bold on each page with the filename, the file date and time (not the current date), and the page number.<\/p>\n<p>3. Output is in a fixed-pitch font, which makes outputting things like tables easy.<\/p>\n<p>4. Printed lines are 80 characters long. Continuation lines are used for lines that are too long. Continuations are marked with bullet characters to make it clearer that they are continuations.<\/p>\n<p>5. Output is to any Windows printer. A <strong>CLP<\/strong> default printer selection is maintained, with the ability to list available printers and select a new default from the command line.<\/p>\n<p>6. Multiple files can be specified and files to list can be specified with wildcards or through the use of a file containing a list of filenames.<\/p>\n<p>7. Operating instructions can be displayed by simply entering the program name with no arguments. The resulting output looks like this:<\/p>\n<div class=\"block\">\n<pre style=\"padding-left: 40px;\"><code><code>C:\\Users\\Jim&gt;clp\nclp default printer: HL-5250DN 2-sided<br \/><br \/><\/code><\/code>clp - print file(s) to clp default printer - 12\/25\/16 (.NET) <br \/><br \/>To execute enter: clp [namfl1...namfln] [-p[n]] [-1|-2] <br \/><br \/><code>where each namfl is a file to print\n   namfls can use paths and wildcards\n   an @namfl prints files named in namfl.nms\n      namfl.nms entries can use paths\n      namfl.nms entries cannot use wildcards or @namfls<br \/>-1 simples (driver default is ignored)<br \/>-2 duplex (driver default is ignored)\n-p lists available printers by number\n-pn selects clp default printer n\n   printer selections are saved between runs\n   (clp has its own default printer)\n<\/code><\/pre>\n<\/div>\n<p>The program is written in C# using the .NET library. Here is a zip file containing the latest source and executable files:\u00a0 \u00a0<a href=\"https:\/\/exeyesoftware.com\/wp-content\/uploads\/2023\/12\/CLP.zip\">CLP.zip<\/a><\/p>\n<p>Enjoy!<\/p>\n<p>-jimc<\/p>\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p><strong>Version 4\/12\/19:<\/strong>  The program was updated to allow parameters to specify 1-sided or 2-sided output, overriding the driver default.  These are especially useful if using <strong>CLP<\/strong> with SendTo: create &#8220;<strong>CLP<\/strong> 1-sided&#8221; and &#8220;<strong>CLP<\/strong> 2-sided&#8221; links in the SendTo folder.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p><strong>Version 10\/19\/20:<\/strong>  Fixed a bug that caused pages to be printed in landscape orientation if the printer driver was defaulting to that.  Changed to force use of Portrait orientation.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p><strong>Version 11\/10\/20:<\/strong> Fixed a related bug that caused duplex pages to flip horizontally rather than vertically.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Version 12\/23\/23:<\/strong> Fixed a bug that caused it to fail if the <strong>CLP<\/strong> default printer name was not a valid Windows printer name.  This could happen if you rename a printer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve decided to post some of the useful small programs I&#8217;ve written for my own use. CLP is a simple C# console program that lists text files on a Windows printer. It was originally intended to list C source code, but it is useful for printing many kinds of text files. Yes you can use &hellip; <a href=\"https:\/\/exeyesoftware.com\/index.php\/2017\/12\/10\/clp-command-line-text-file-list-program\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">CLP &#8211; Command Line Text File List Program<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2,4],"tags":[13,32,15],"class_list":["post-51","post","type-post","status-publish","format-standard","hentry","category-computers","category-software","tag-clp","tag-command-line-programs","tag-utilities"],"_links":{"self":[{"href":"https:\/\/exeyesoftware.com\/index.php\/wp-json\/wp\/v2\/posts\/51","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exeyesoftware.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/exeyesoftware.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/exeyesoftware.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exeyesoftware.com\/index.php\/wp-json\/wp\/v2\/comments?post=51"}],"version-history":[{"count":19,"href":"https:\/\/exeyesoftware.com\/index.php\/wp-json\/wp\/v2\/posts\/51\/revisions"}],"predecessor-version":[{"id":814,"href":"https:\/\/exeyesoftware.com\/index.php\/wp-json\/wp\/v2\/posts\/51\/revisions\/814"}],"wp:attachment":[{"href":"https:\/\/exeyesoftware.com\/index.php\/wp-json\/wp\/v2\/media?parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/exeyesoftware.com\/index.php\/wp-json\/wp\/v2\/categories?post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/exeyesoftware.com\/index.php\/wp-json\/wp\/v2\/tags?post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}