From: George George Date: 2009-06-23T14:00:12+09:00 Subject: Re: formatting a listing Brian Candler wrote: > At a guess, perhaps you're on a Windows platform and the paragraphs are > terminated by \r\n\r\n instead of \n\n. Try: > > rows = src.split(/\r?\n\r?\n/).collect ... etc > > In a regular expression, \r? means 0 or 1 occurrences of \r Thank you Brian. Am on ubuntu linux and Ruby 1.8.7. Let me put some debugger and work it out why its not printing the desirable output. @David Black: My input consists of digits and not letters, that is why i used digits in the examples above; in short what i really wanted is: Given a listing 1 2 3 white space 3.05 4 5 whitespace -6.3 7 Produce an output such that: 1,-3.05,-6.3 2,4,7 3,5 or 1,-3.05,-6.3 2,4,7 3,5,0 -- Posted via http://www.ruby-forum.com/.