The Linux Experience: What’s Missing

It’s been a week or two since I dedicated my laptop entirely to Whitebox Linux, and so far I have few complaints.

There are some applications that I rely on that are either not available on Linux, or for which I don’t have a spare $100,000 for the license. In the former category is UltraEdit. It’s one of those applications that seem pretty simple to start with, and then you find one key feature that you can’t do without. For me that feature is column-mode editing.

Long-story-short, column-mode editing allows you to select, copy and paste a rectangular block of text. It also allows you to select a single column, start typing, and have whatever you type echoed on every line selected.

So for example if you want to create a view over a table with fifty columns and you want to wrap every column in an expression such as:
Decode(col1,’ ‘,’N/A’,col1) col1,
…then you;

  1. DESC the table
  2. paste the result into UltraEdit
  3. use column mode to select and copy the rectangle that holds the column names
  4. paste the result over to the right, twice

… and this gives you your list of column names three times, looking something like;

col1 col1 col1
col2 col2 col2
col3 col2 col3

You then use column mode to select the gap to the left of the leftmost column of column names (nothing confusing about this example!) and type “Decode(“. This gives you:

Decode(col1 col1 col1
Decode(col2 col2 col2
Decode(col3 col3 col3

Then you select the gap to the left of the second column of column names, and type “,’ ‘,’N/A’,” giving you:

Decode(col1,’ ‘,’N/A’,col1 col1
Decode(col2,’ ‘,’N/A’,col2 col2
Decode(col3,’ ‘,’N/A’,col3 col3

Well, you see how this works anyway. Once you get into the swing of things this is very fast and pretty soon you have:

Decode(col1,’ ‘,’N/A’,col1) col1,
Decode(col2,’ ‘,’N/A’,col2) col2,
Decode(col3,’ ‘,’N/A’,col3) col3,

Now you could do the same thing by querying user_tab_columns, but with a complex or lengthy expression I much prefer this way. For example in:

Decode(LTrim(col1,’0′),’}’,0,’A’,1,’B’,2,zoned_to_number(col1)) col1,

… I just can’t keep track of all of those single quotes that have to be doubled-up.

It also will search and replace on special characters such as carriage returns very easily, so you can remove occurances of blank lines by replacing “^p^p” with “^p” until they’re all gone for example, or get a line break after each comma by replacing commas with “,^p”.

Not … available … on … Linux.

Ouch.

Still, if you’re on Windows then I recommend it. For $40 I’d give a copy to every DBA and developer (only if they’re on Windows, of course. It’d be a bit of a waste otherwise.)

About these ads

18 thoughts on “The Linux Experience: What’s Missing

  1. I use Textpad for the same reasons you mention above; column editing, enhanced character replacement (end line, start line, etc.). Similar cost to ultraedit; but, no linux version either :-(

  2. man cut – you can create a macro in vi to grab a range of lines and write to temporary file, then cut the column(s) you want, play, insert into original doc.

    :g/^$/s/// to remove all blank lines.
    :g/,/s//,^V^M/ (that’s control-v, control-m, the control-v escapes the control-m) to put a newline after each comma.

  3. Have you tried JEdit (www.jedit.org>)? JEdit has good support for column editing. I was able to replicate your example easily. To select regions, hold down the control key and left mouse click and drag. JEdit is open source an it runs on Windows too.

  4. I love UltraEdit. When I’m on windows I always use it. I’ve had a license for years and don’t begrudge paying for updates because it’s cool.

    Cheers

    Tim…

  5. I’ve just started using vim for the very reason it’s cross platform. The learning curve is steep, I hope I can climb it.

  6. gvim.

    Works on all platforms I care to think about, does column-mode editing, macros, pre-formatting, auto-indent, multiple windows, whatever.

    Learning curve is steep. Then again, it only happens once…

  7. Well, plenty of options here.

    I gave crossover a go, but the UltraEdit 10 install is some really funky program that doesn’t play well at all. I tried a different technique recommended at the codeweavers website but the instructions don’t seem to apply to the latest version of Crossover. Tsh.

    I’m very tempted by gvim — when I started using vi again recently after quite a long absence I found that my fingers flew unbidden to delete words, copy the next 5 lines, delete to the end or start of the document etc. The only problem I’m finding is beingable to compile vim with the gui option — the docs are a little vague on this, so if anyone can help with that I’d be happy as a pig in mud.

    In the meantime, I’m going to try Crimson Editor and JEdit … it’s always good to have choices!

  8. Just run cygnus-ed under e-uae amiga emulator… it boots in 4 seconds and just works :)

  9. Why not to move to unix-way totally?

    If you love Windaz apps – stay on Win. If you wanna be effective on unices – go unix way.

    You can try vim, emacs, joe, jed, nedit, pico and lot of other editors for free.

    And not forget to visit VIM site. Wiki is a grate place for newbies.

    SY, SUre

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s