.comment-link {margin-left:.6em;}

Oracle Sponge -- Now Moved To Wordpress

Please use http://oraclesponge.wordpress.com

Friday, August 26, 2005

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.)

16 Comments:

At 11:19 AM, Blogger Thomas Kyte said...

Have you tried crossover.


http://www.codeweavers.com/



Last I used it, ran word, ppt, excel and even installed and demo'ed ultra edit to someone that said "can't do linux, no ultra edit" so I know it *used* to work.

 
At 11:27 AM, Blogger David Aldridge said...

Hmmm, $40 eh? Well the priceis certainly reasonable. I'll give their trial version a go and see if I can break it.

Thanks 'ee.

 
At 12:15 PM, Blogger John Baughman said...

I can't live without UltraEdit...
I love the macros too and the easy syntax highlighting configuration.

 
At 12:50 PM, Anonymous Anonymous said...

Have you tried Crimson Editor

 
At 12:52 PM, Anonymous Anonymous said...

Have you tried Crimson Editor
oops forgot to give my name... that was me :)

 
At 3:35 PM, Anonymous Anonymous said...

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.

 
At 8:06 PM, Anonymous Anonymous said...

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.

 
At 11:49 AM, Blogger Tim... said...

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...

 
At 5:36 PM, Blogger William Robertson said...

Time to get Vim. These days I have the same editor on Windows, Linux and Apple Mac (and it costs $40 kess than UltraEdit).

 
At 6:29 PM, Anonymous Anonymous said...

You might want to try nedit for unix editing.

 
At 8:15 PM, Anonymous Anonymous said...

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.

 
At 6:46 PM, Blogger Noons said...

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...

 
At 12:00 PM, Blogger David Aldridge said...

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!

 
At 12:03 PM, Blogger David Aldridge said...

Oh wait -- Crimson Editor is Windows only. Silly adewri!

 
At 1:49 PM, Anonymous Anonymous said...

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

 
At 11:19 PM, Anonymous Anonymous said...

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

 

Post a Comment

<< Home