Do you want to build by row or by column? Building by row is easy. It's not much use for cases where you need to keep changing the number of columns, but I use a search and replace process to convert single columns into tab-delimited tables ordered by row using these strings (this is for five columns):

Find: (.*)\r(.*)\r(.*)\r(.*)\r(.*)\r
Replace With: \1\t\2\t\3\t\4\t\5\r

This works for lists of several thousand lines - in fact, for arbitrary length lists, and for situations where the need is common but only involves a limited number of columns I'd just save each version as a pattern.

Building by column - which is what you show below - is more difficult, particularly if you want to print the result - do you break at the bottom of the page (how many lines per page?), or keep on going until you have exhausted the list? If you are going to exhaust the list, then for arbitrary length lists I think you need temporary files to build stacks of entries from which you subsequently pick off entries to build your final columnated (is that a word?) file. Sounds like a PITA, but scriptable if necessary - but I'd avoid it if at all possible and push for the 'by row' approach.

On Wed, 17 May 2006 2:44:45 PM PST Arthur Knapp wrote:

Yeah, I actually need something like this:

  apple
  banana
  pear
  peach

Turned into something like this:

  apple       pear
  banana    peach

Some call it laziness: I call it 'efficient allocation of resources'

Peter Tattersall
http://www.zerobyzero.ca/Weathertop/
http://www.zerobyzero.ca/Starstruck/
L'Osservatore Ponte di Legno
43 49 N 79 34 W


--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to