Sublime Text: Add character in column position
<p>I have a Python file with a few hundred lines of code.  The longest line is 146 characters.  How would I put <code>#</code> in column 200 down the whole file within Sublime Text?  Preferably with one or two Sublime Text commands?</p>

<p><code>1                                                           200</code></p>

<p><code>print("Hello world!")                                       #</code>      </p>

<p>Here's a possible solution:</p>

<pre><code>N = 200
output = [l.rstrip() for l in f]
output = ["{0}#{1}".format(
    l[:len(l[:N])] + ' ' * (N - len(l[:N])), l[N:]) for l in output]

print("\n".join(output))
</code></pre>

<p>Or written differently:</p>

<pre><code>N = 200
output = []
for l in f:
    l = l.rstrip()
    l1 = len(l[:N])
    output.append("{0}#{1}".format(l[:l1] + ' ' * (N - l1), l[N:]))

print("\n".join(output))
</code></pre>

python comments sublimetext2 sublimetext3