From: Marc Hoeppner Date: 2007-07-20T15:16:27+09:00 Subject: line.split with some complicating factors... Hi all, I've been thinking about this for a while but cant figure out an efficient (or any actually) way to do the following: a line contains a list of coordinates (specifying a range) separated by a "," like so: 50586..50639,50795..51859,60005..60058,60256..61236 Pulling out the separate coordinates via split is of course rather simple. But, here's the catch... I not only need the given ranges, but also the stretches in between (I am pulling the coordinates out of a large text file, so there is no good way to manipulate the source). So the whole range is in reality everything between the first and the last number...However, I have to treat the originally given ranges and the stretches in between differently. The given ranges are printed in upcase, the parts not specified in downcase. Now, a way this could look like would be: E50586..50639,50640..50795,E50795..51859,.. The "E" at the beginning is then used to identify the original ranges and as a condition for printing in upcase. So, my point being...I have absolutely no clue how to do this. The procedure would have to split the given ranges but also immediately write the missing ranges in the correct order. If anyone has an idea how to approach this, I could really need some advice here. Cheers, Marc -- Posted via http://www.ruby-forum.com/.