On Fri, Jul 06, 2007 at 07:55:05AM +0200, foobar wrote: > Robin Lee Powell schrieb: > > Someone *must* have written this. Probably lots of someones. > > May I have your code? > > > > The problem is (very) simple. I have: > > > > (("foo" "1" "bar") ("baz" "baaaaaaaaz" "2")) > > > > I wish to output (something like): > > > > foo 1 bar > > baz baaaaaaaaz 2 > > > > That is, given a list of lists of strings and a given screen > > width, pad the strings appropriately and join them, returning a > > list of strings. > > As the others allready suggested the fmt egg does this and many > things more.
The "columnar" formatter in fmt fails totally on my dataset: "The current column width is divided evenly among the columns", but one of my columns is 2 characters wide and one of the others over a hundred, so it looks horrible and isn't truncated at all: ID Artist Title Bitrate URL 18 Basil Poledouris Starship Troopers - Klendathu128000 file:///var/tmp/xmms2test/Basil-Poledouris--Starship_Troopers--Klendathu_Drop.mp3 19 No Artist RedDawn-MainTitle 128000 file:///var/tmp/xmms2test/Basil_Poledouris--Red_Dawn--Main_Title.mp3 21 King Kong & D.Jungle GirlsBoom Boom Dollar 160000 file:///var/tmp/xmms2test/Dance_Dance_Revolution--Boom_Boom_Dollar.mp3 22 Daniel Beddingfield Gotta Get Through This 128000 file:///var/tmp/xmms2test/Daniel_Beddingfield--Gotta_Get_Through_This.mp3 What I'd *like* is for columns to use no more than their max width (plus one or two pad chars) and for the right-most column to be truncated. It may be that fmt-columns would help, but the explanation of fmt-columns is *totally* opaque to me; can anyone explain it? -Robin _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users