[OT] Text Editor that Does Tables?

I enter a lot of tables as C-language comments.  I use vertical bars and so 
on to separate columns.

A typical table might be a Boolean function, or a list of I/O pins and how 
they are assigned.  2-100 rows is typical, and 2-5 columns is typical.

Widening columns is a huge headache, as I have to do every row of the table 
(sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but even 
then it is a huge job.

Is there a text editor out there (or a feature of SlickEdit I'm unaware of) 
that supports ASCII tables directly?

Thanks.
-- 
David T. Ashley              (dta@e3ft.com)
http://www.e3ft.com          (Consulting Home Page)
http://www.dtashley.com      (Personal Home Page)
http://gpl.e3ft.com          (GPL Publications and Projects) 


0
dta (455)
6/27/2008 4:40:55 PM
comp.lang.c 30397 articles. 2 followers. spinoza1111 (3246) is leader. Post Follow

21 Replies
317 Views

Similar Articles

[PageSpeed] 45

On Jun 27, 12:40 pm, "David T. Ashley" <d...@e3ft.com> wrote:

> Widening columns is a huge headache, as I have to do every row of the table
> (sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but even
> then it is a huge job.

I would be there's a way to do it with emacs, though off the top of my
head I only know how to delete a vertical column, not insert one.

However emacs is not for everyone... it's as much a religion as a
tool.
0
cs_posting (543)
6/27/2008 5:02:52 PM
On Fri, 27 Jun 2008 12:40:55 -0400, "David T. Ashley" <dta@e3ft.com>
wrote:

>I enter a lot of tables as C-language comments.  I use vertical bars and so 
>on to separate columns.
>
>A typical table might be a Boolean function, or a list of I/O pins and how 
>they are assigned.  2-100 rows is typical, and 2-5 columns is typical.
>
>Widening columns is a huge headache, as I have to do every row of the table 
>(sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but even 
>then it is a huge job.

Why not use Perl to do this? I used to use awk, back in ancient times,
but Perl is very well suited to this kind of text manipulation. Very
C-ish syntax so the learning curve wouldn't be too high.

The canonical free Windows distro is from
<http://www.activestate.com/Products/activeperl/index.mhtml>
Note that they do have commercial "pro" versions as well.

-- 
Rich Webb     Norfolk, VA
0
bbew.ar (763)
6/27/2008 5:03:47 PM
David T. Ashley wrote:
> Widening columns is a huge headache, as I have to do every row of the table 
> (sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but even 
> then it is a huge job.
> 
> Is there a text editor out there (or a feature of SlickEdit I'm unaware of) 
> that supports ASCII tables directly?

Emacs can do that using the rectangle commands. C-x r k (kill-rectangle)
to remove a rectangular block (i.e. make a column narrower), C-x r t
(string-rectangle) to make a new column or to make one wider. Maybe your
editor has similar functions.


  Stefan

0
stefan.news (242)
6/27/2008 5:23:58 PM
"Stefan Reuther" <stefan.news@arcor.de> wrote in message 
news:g43eoe.kc.1@stefan.msgid.phost.de...
> David T. Ashley wrote:
>> Widening columns is a huge headache, as I have to do every row of the 
>> table
>> (sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but 
>> even
>> then it is a huge job.
>>
>> Is there a text editor out there (or a feature of SlickEdit I'm unaware 
>> of)
>> that supports ASCII tables directly?
>
> Emacs can do that using the rectangle commands. C-x r k (kill-rectangle)
> to remove a rectangular block (i.e. make a column narrower), C-x r t
> (string-rectangle) to make a new column or to make one wider. Maybe your
> editor has similar functions.

Thanks, I'll look into that.  It is OK with me to use two text editors ... 
one for most editing and one for tables.

Where would I get a version of emacs for Windows (I use it, but barely, only 
on my Linux box)?

I'll also contact SlickEdit to see what they have to say about editing 
tables. 


0
dta (455)
6/27/2008 5:38:16 PM
"David T. Ashley" <dta@e3ft.com> wrote in message 
news:JrKdnSeNm_EVuPjVnZ2dnUVZ_gOdnZ2d@giganews.com...
>> Emacs can do that using the rectangle commands. C-x r k (kill-rectangle)
>> to remove a rectangular block (i.e. make a column narrower), C-x r t
>> (string-rectangle) to make a new column or to make one wider. Maybe your
>> editor has similar functions.
>
> Thanks, I'll look into that.  It is OK with me to use two text editors ... 
> one for most editing and one for tables.
>
> Where would I get a version of emacs for Windows (I use it, but barely, 
> only on my Linux box)?

I copy/pasted "emacs for Windows" from your message, and fed it
to Google, whose first hit produces:

http://www.google.com/search?hl=en&q=emacs+for+Windows&btnG=Google+Search

See section 2.

-Mike



0
mkwahler (3821)
6/27/2008 6:16:54 PM
"Mike Wahler" <mkwahler@mkwahler.net> wrote in message 
news:-rKdnfc_xaQGs_jVnZ2dnUVZ_g2dnZ2d@earthlink.com...
> "David T. Ashley" <dta@e3ft.com> wrote in message 
> news:JrKdnSeNm_EVuPjVnZ2dnUVZ_gOdnZ2d@giganews.com...
>>> Emacs can do that using the rectangle commands. C-x r k (kill-rectangle)
>>> to remove a rectangular block (i.e. make a column narrower), C-x r t
>>> (string-rectangle) to make a new column or to make one wider. Maybe your
>>> editor has similar functions.
>>
>> Thanks, I'll look into that.  It is OK with me to use two text editors 
>> ... one for most editing and one for tables.
>>
>> Where would I get a version of emacs for Windows (I use it, but barely, 
>> only on my Linux box)?
>
> I copy/pasted "emacs for Windows" from your message, and fed it
> to Google, whose first hit produces:
>
> http://www.google.com/search?hl=en&q=emacs+for+Windows&btnG=Google+Search

Make that:

http://www.gnu.org/software/emacs/windows/ntemacs.html

The first URL I posted was of course the google search command.

-Mike


0
mkwahler (3821)
6/27/2008 6:18:18 PM
"David T. Ashley" <dta@e3ft.com> writes:

> "Stefan Reuther" <stefan.news@arcor.de> wrote in message 
> > Emacs can do that using the rectangle commands. C-x r k (kill-rectangle)
> > to remove a rectangular block (i.e. make a column narrower), C-x r t
> > (string-rectangle) to make a new column or to make one wider. Maybe your
> > editor has similar functions.
> 
> Thanks, I'll look into that.  It is OK with me to use two text editors ... 
> one for most editing and one for tables.

If you're going for emacs, you might want to consider org-mode, which
has a nice table editing mode that can be used as a minor mode; see
http://orgmode.org/manual/Tables.html#Tables.

tg
0
6/27/2008 6:33:06 PM


David T. Ashley <dta@e3ft.com> >wrote:

>I enter a lot of tables as C-language comments.  I use vertical bars and so 
>on to separate columns.
>
>A typical table might be a Boolean function, or a list of I/O pins and how 
>they are assigned.  2-100 rows is typical, and 2-5 columns is typical.
>
>Widening columns is a huge headache, as I have to do every row of the table 
>(sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but even 
>then it is a huge job.

Doing this sort of thing is a snap using UltraEdit.

http://www.ultraedit.com/


-- 
Guy Macon
<http://www.GuyMacon.com/>

0
Guy
6/27/2008 7:43:47 PM
"Mike Wahler" <mkwahler@mkwahler.net> wrote in message 
news:xpadnaJtfcxts_jVnZ2dnUVZ_rzinZ2d@earthlink.com...
>
> "Mike Wahler" <mkwahler@mkwahler.net> wrote in message 
> news:-rKdnfc_xaQGs_jVnZ2dnUVZ_g2dnZ2d@earthlink.com...
>> "David T. Ashley" <dta@e3ft.com> wrote in message 
>> news:JrKdnSeNm_EVuPjVnZ2dnUVZ_gOdnZ2d@giganews.com...
>>>> Emacs can do that using the rectangle commands. C-x r k 
>>>> (kill-rectangle)
>>>> to remove a rectangular block (i.e. make a column narrower), C-x r t
>>>> (string-rectangle) to make a new column or to make one wider. Maybe 
>>>> your
>>>> editor has similar functions.
>>>
>>> Thanks, I'll look into that.  It is OK with me to use two text editors 
>>> ... one for most editing and one for tables.
>>>
>>> Where would I get a version of emacs for Windows (I use it, but barely, 
>>> only on my Linux box)?
>>
>> I copy/pasted "emacs for Windows" from your message, and fed it
>> to Google, whose first hit produces:
>>
>> http://www.google.com/search?hl=en&q=emacs+for+Windows&btnG=Google+Search
>
> Make that:
>
> http://www.gnu.org/software/emacs/windows/ntemacs.html
>
> The first URL I posted was of course the google search command.
>
> -Mike

Thanks.  I've heard about web search engines, but never tried one.  Looks 
like they might be useful.

Hey, does Google have stock?  Maybe I can get in on the ground floor before 
any other investors? 


0
dta (455)
6/27/2008 7:46:57 PM
David T. Ashley wrote:
> I enter a lot of tables as C-language comments.  I use vertical bars and so 
> on to separate columns.
> 
> A typical table might be a Boolean function, or a list of I/O pins and how 
> they are assigned.  2-100 rows is typical, and 2-5 columns is typical.
> 
> Widening columns is a huge headache, as I have to do every row of the table 
> (sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but even 
> then it is a huge job.
> 
> Is there a text editor out there (or a feature of SlickEdit I'm unaware of) 
> that supports ASCII tables directly?

Notepad++ (Free, Sourceforge) has a couple of features useful here :

a) Shift-Alt-Clk selects any rectangular column of text,
corners set by EditCursor, and current mouse cursor.
You can thus add, or delete whole columns.
^C, ^V of this column, works as expected - still column-tagged.

b) A new mode Column Editor, allows a String to be duplicated from
the Edit Cursor to the EOF, and extends any lines it needs to.
( so you could enter '    |    ' for example to get
your column lines.
The EOF is a quirk, which means you would pull your column block
out to a separate file, and paste back later.

-jg

0
no.spam2900 (819)
6/27/2008 7:57:47 PM
On Fri, 27 Jun 2008 12:40:55 -0400, "David T. Ashley"
<dta@e3ft.com> wrote:

>I enter a lot of tables as C-language comments.  I use vertical bars and so 
>on to separate columns.
>
>A typical table might be a Boolean function, or a list of I/O pins and how 
>they are assigned.  2-100 rows is typical, and 2-5 columns is typical.
>
>Widening columns is a huge headache, as I have to do every row of the table 
>(sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but even 
>then it is a huge job.
>
>Is there a text editor out there (or a feature of SlickEdit I'm unaware of) 
>that supports ASCII tables directly?

I have an ancient version of slickedit that I use and am quite
happy with.  I never use macros so you can probably do something
much more clever than what I would do.  However I would probably
do something like this:  Capture an entire column of vertical
bars (right mouse key select).  Copy it to an empty scratch
buffer.  Select the a rectangular block that includes the space
you want and the vertical bars.  Clip it and replace the original
column of vertical bars.  It's only two select/copy/paste steps.
I daresay you could make a macro out of it.



Richard Harter, cri@tiac.net
http://home.tiac.net/~cri, http://www.varinoma.com
Save the Earth now!!
It's the only planet with chocolate.
0
cri (1432)
6/27/2008 8:13:53 PM
On Fri, 27 Jun 2008 12:40:55 -0400, "David T. Ashley" <dta@e3ft.com>
wrote:

>I enter a lot of tables as C-language comments.  I use vertical bars and so 
>on to separate columns.
>
>A typical table might be a Boolean function, or a list of I/O pins and how 
>they are assigned.  2-100 rows is typical, and 2-5 columns is typical.
>
>Widening columns is a huge headache, as I have to do every row of the table 
>(sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but even 
>then it is a huge job.
>
>Is there a text editor out there (or a feature of SlickEdit I'm unaware of) 
>that supports ASCII tables directly?
>

You can try kedit. Or THE (The Hessling Editor), which is a clone of
Xedit with enhancements. Uses REXX as it's macro language and can
do block editing. 

Regards
  Anton Erasmus


0
nobody62 (615)
6/27/2008 8:17:56 PM
"David T. Ashley" wrote:
> 
> I enter a lot of tables as C-language comments.  I use vertical
> bars and so on to separate columns.
> 
> A typical table might be a Boolean function, or a list of I/O
> pins and how they are assigned.  2-100 rows is typical, and 2-5
> columns is typical.
> 
> Widening columns is a huge headache, as I have to do every row of
> the table (sometimes hundreds of lines).  I use a SlickEdit macro
> repeatedly, but even then it is a huge job.
> 
> Is there a text editor out there (or a feature of SlickEdit I'm
> unaware of) that supports ASCII tables directly?

Look around for VEDIT PLUS.  You can set every tabstop as needed,
and separate fields with tabs.

-- 
 [mail]: Chuck F (cbfalconer at maineline dot net) 
 [page]: <http://cbfalconer.home.att.net>
            Try the download section.


0
cbfalconer (19194)
6/27/2008 8:23:09 PM
On 27 Jun., 18:40, "David T. Ashley" <d...@e3ft.com> wrote:
> I enter a lot of tables as C-language comments.  I use vertical bars and so
> on to separate columns.
>
> A typical table might be a Boolean function, or a list of I/O pins and how
> they are assigned.  2-100 rows is typical, and 2-5 columns is typical.
>
> Widening columns is a huge headache, as I have to do every row of the table
> (sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but even
> then it is a huge job.
>
> Is there a text editor out there (or a feature of SlickEdit I'm unaware of)
> that supports ASCII tables directly?
>
> Thanks.
> --
> David T. Ashley              (d...@e3ft.com)http://www.e3ft.com         (Consulting Home Page)http://www.dtashley.com     (Personal Home Page)http://gpl.e3ft.com         (GPL Publications and Projects)

Ultraedit has a great collum mode (alt-c to toggle between collum and
normal mode)
it can do what I think you want.

it hard to explain how it works but,
try to mark a collum of text, and then cut and paste or type
something, you will see how it works

-Lasse


0
langwadt1 (194)
6/27/2008 9:04:31 PM
On Fri, 27 Jun 2008 12:40:55 -0400, David T. Ashley wrote:


> Widening columns is a huge headache, as I have to do every row of the table 
> (sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but even 
> then it is a huge job.

You can do this easily with JEdit. It has a column mode that you can put
the editor in, but you can also just hold down the ctrl key and click and
drag your mouse to select your column. Then what you type in is applied
to all the lines in the column. So you could do this to create each of your
column's vertical lines - select an area and type the character you're
using for column once, and it will appear on every line in your column.
And of course pressing space will widen you column, delete will narrow it.

On the download page it does say "Even if you're "just a user", you  should
still try the development version". Nah - don't. Go for the stable one.

I use it as my main development editor on both windows and linux. It has
lots of plugins that you can download for it, although the only one I
really use I guess is the diff plugin, which is a pretty good one - *some*
of the other ones are of dubious quality.

Take a look at the screenshots on the website:

http://www.jedit.org/index.php?page=screenshots

I can't believe no one else suggested it :-)

Regards,

Paul.
0
pt1 (2)
6/28/2008 5:57:28 AM
David T. Ashley wrote:

> Thanks.  I've heard about web search engines, but never tried one.  Looks 
> like they might be useful.

Are you kidding?

> Hey, does Google have stock?  Maybe I can get in on the ground floor before 
> any other investors?

Try Google to search for it.

For your table question: I'm using UltraEdit, which has a column mode, but
it doesn't sound like a good idea to code 5x200 cell size tables in C
comments. I would use Excel (or OpenOffice on Linux) for it. Then save it
as CSV. Maybe your implementation for the logic function can just read this
CSV and use it at runtime. Or you can write a source code generator, if it
is time critical. You can even write a generator for your comments and a
program, which uses the CSV as test input and calls your function to verify
it against the table.

-- 
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
0
fb (1533)
6/28/2008 7:22:41 AM
In comp.arch.embedded David T. Ashley <dta@e3ft.com> wrote:
> I enter a lot of tables as C-language comments.  I use vertical bars and so 
> on to separate columns.
> 
> A typical table might be a Boolean function, or a list of I/O pins and how 
> they are assigned.  2-100 rows is typical, and 2-5 columns is typical.
> 
> Widening columns is a huge headache, as I have to do every row of the table 
> (sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but even 
> then it is a huge job.
> 
> Is there a text editor out there (or a feature of SlickEdit I'm unaware of) 
> that supports ASCII tables directly?

And, since nobody yet mentioned it, and because the word 'emacs' has
fallen, I'm suggesting the vim editor for All Your Editing Needs.

-- 
:wq
^X^Cy^K^X^C^C^C^C
0
usenet3433 (123)
6/28/2008 7:10:30 PM
On 2008-06-27, David T. Ashley <dta@e3ft.com> wrote:
> I enter a lot of tables as C-language comments.  I use vertical bars and so 
> on to separate columns.
>
> A typical table might be a Boolean function, or a list of I/O pins and how 
> they are assigned.  2-100 rows is typical, and 2-5 columns is typical.
>
> Widening columns is a huge headache, as I have to do every row of the table 
> (sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but even 
> then it is a huge job.

Bit of a golden oldie this one (written for DOS and OS/2) but don't
let that put you off - it's tiny, _uncomfortably_ fast and solves
your problem in a very natural way.  The feature set is not
particularly extensive but it always strikes me as being very well
chosen:

http://tinyurl.com/63llgp

Unlike most other editors, this one's block indent functions work
at the current cursor position rather than the home position.
Adjusting your table columns is as simple as selecting the lines
in question, moving to the right position and hitting shift F7/F8
as appropriate.

I see from your headers that you are running Windows - if your
version supports it (ie NT or 2000) I recommend running the OS/2
version which will give you long filename support.  However, it
isn't really such big deal if you can't - run the DOS version and
use drag and drop which will sort out DOS-compatible filenames
transparently.  Both versions are included in the same zip.

-- 
Andrew Smallshaw
andrews@sdf.lonestar.org
0
andrews (362)
6/28/2008 9:24:39 PM
On Sat, 28 Jun 2008 19:10:30 +0000, Ico wrote:

> And, since nobody yet mentioned it, and because the word 'emacs' has
> fallen, I'm suggesting the vim editor for All Your Editing Needs.

I don't use emacs but do on occasion use vi, although after about an hour
of using it I have to ask someone to untangle my fingers ;-)

Regards,

Paul.
0
pt1 (2)
6/29/2008 7:11:08 AM
David T. Ashley escribi�:
> I enter a lot of tables as C-language comments.  I use vertical bars and so 
> on to separate columns.
> 
> A typical table might be a Boolean function, or a list of I/O pins and how 
> they are assigned.  2-100 rows is typical, and 2-5 columns is typical.
> 
> Widening columns is a huge headache, as I have to do every row of the table 
> (sometimes hundreds of lines).  I use a SlickEdit macro repeatedly, but even 
> then it is a huge job.
> 
> Is there a text editor out there (or a feature of SlickEdit I'm unaware of) 
> that supports ASCII tables directly?

Multiedit. I bought version 8.0 and have been using it since 1998.
0
6/30/2008 1:32:53 PM
On Jun 27, 5:40=A0pm, "David T. Ashley" <d...@e3ft.com> wrote:
> I enter a lot of tables as C-language comments. =A0I use vertical bars and=
 so
> on to separate columns.
>
> A typical table might be a Boolean function, or a list of I/O pins and how=

> they are assigned. =A02-100 rows is typical, and 2-5 columns is typical.
>
> Widening columns is a huge headache, as I have to do every row of the tabl=
e
> (sometimes hundreds of lines). =A0I use a SlickEdit macro repeatedly, but =
even
> then it is a huge job.
>
> Is there a text editor out there (or a feature of SlickEdit I'm unaware of=
)
> that supports ASCII tables directly?

I like ConTEXT. It does column cut-and-paste

--
Nick Keighley
0
6/30/2008 2:59:30 PM
Reply: