Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Highly inspired by in dbenham's answer, I propose a similar but simpler variation based in the fact that the backspace character can be inserted in its raw form (only in batch files, attempting this in the console directly won't work as expected):</p> <p><code>set /p var=.'BS' Leading spaces will now show properly.</code></p> <p>The 'BS' character can be inserted by typing Alt + Numpad 008 (8 is backspace's ASCII code, won't work using the alphanumeric keys typically found above the letters), using a <strong>good</strong> text editor (such as <a href="http://notepad-plus-plus.org/" rel="nofollow noreferrer">Notepad++</a>, Windows Notepad simply performs the backspace action).</p> <p>If unable to <em>insert</em> the <strong>character</strong>, Notepad++ has a useful feature for this: in <em>TextFX</em> menu, choose <em>TextFX Tools</em> followed by <em>Insert Ascii Chart or Character</em>: <img src="https://ufqi.com/blog/wp-content/uploads/2014/08/notepad++-ascii-201408.png" alt="Insert Ascii Chart or character"> The desired character is the <code>BS</code> (white letters on black background on the screenshot) found in line 9 (ASCII character <code>8</code> - as stated above - as it's a zero-indexed table).</p> <p>If <em>still</em> the result is <strong>not</strong> the one described, try changing the file encoding to ASCII. Using Notepad++:</p> <ol> <li>Make a backup copy of the script or perform an experiment in a separate file, as non-ASCII characters (accented character, non-Latin etc.) are <strong>lost</strong> in this conversion.</li> <li>In <em>Encoding</em> menu, choose <em>Convert to ANSI</em></li> <li>Save and check the result again...</li> </ol> <p>Tested with Windows 7 Professional SP1.</p> <p>Credits also go to:</p> <ul> <li>@DavidCallanan for questioning the obtained result.</li> <li>Wadelau for <a href="http://ufqi.com/blog/notepad-datetime-ascii-tips/" rel="nofollow noreferrer">writing about Notepad++ at <em>ufqi.com</em></a> (where the screenshot was extracted from).</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload