title: printing a paragraph in windows batch
body: <p>The following code works pretty well printing the paragraph  </p>
  
  <pre><code>@echo off
  setlocal disableDelayedExpansion
  set "skip="
  for /f "delims=:" %%N in (
    'findstr /x /n ":::BeginText" "%~f0"'
  ) do if not defined skip set skip=%%N
  &gt;test.txt (
    for /f "skip=%skip% tokens=*" %%A in (
     'findstr /n "^" "%~f0"'
    ) do (
      set "line=%%A"
      setlocal enableDelayedExpansion
      echo(!line:*:=!
      endlocal
    )
  )
  type test.txt
  exit /b
  
  :::BeginText
  This text will be exactly preserved with the following limitations:
  
    1) Each line will be terminated by CR LF even if original has only LF.
  
    2) Lines are limited in length to approximately 8191 bytes.
  
  Special characters like ^ &amp; &lt; &gt; | etc. do not cause a problem.
  Empty lines are preserved!
  ;Lines beginning with ; are preserved.
  :::Leading : are preserved
  </code></pre>
  
  <p>Is there a way to add a text marker like <code>:::Endtext</code> so that only the paragraph between 
    <code>:::BeginText</code> and <code>:::Endtext</code> is printed.</p>