Remove Columns

Download removeColumn.js
Author: sam AT sam-i-am.com
last modified: July 31, 2001

This script provides a kind-of column mode delete for Homesite. A prompt accepts a range and deletes these text columns from the selection. (or if you just give it a number it will assume the range is 0-x)
It requires a selection to run.

Usage

Selecting the following lines and hitting your RemoveColumns button (or assigned keyboard shortcut) ...

        =13=    my $HOST = "localhost";
        =14=    my $PORT = "8008";
        =15=    
        =16=    sub prefix {
        =17=      my $now = localtime;
        =18=    
        =19=      join "", map { "[$now] [${$}] $_\n" } split /\n/, join "", @_;
        =20=    }

throws a prompt:

removeColumns in action screenshot - prompting for columns to delete in the selection

screenshot

You enter in your range, 0-16 in this example, which results in

my $HOST = "localhost";
my $PORT = "8008";

sub prefix {
  my $now = localtime;

  join "", map { "[$now] [${$}] $_\n" } split /\n/, join "", @_;
}

I could have also entered just 16 to get the same result. You can also slice out columns from the middle of a set of lines (e.g. 10-22), or chop off the end (truncate) from a given point by omitting the range end (e.g. 10-)