From: Giampiero Zanchi Date: 2009-04-21T16:41:43+09:00 Subject: Re: create a text file with data custom positioned? I have a function; it receives a string, a char with possible values l or r (left or right alignment), the desired length and a filler char def just(a_string,lr,a_len,a_fil) if lr == 'l' then a_string = a_string.ljust(a_len,a_fil) else a_string = a_string.rjust(a_len,a_fil) end end then I use it as follows (with arrays of strings, alignment marks and lengths): just(cols[i],aligns[i],col_len[i]," ") for instance just("My_string","l",12,".") produces "My_string..." hope this helps ciao -- Posted via http://www.ruby-forum.com/.