From: Marc Hoeppner Date: 2007-07-19T20:16:12+09:00 Subject: Re: identify and extract positions from a string - how to? Thanks a lot, dont know how I missed that in the string chapter. Anyhow, another thing came up: while string[1..10] is pretty much what I was looking for - is there any way that I can substitute the numbers (or the whole content of the square brackets for that matter) with variables? As it is now I have a file that contains coordinates and a second file that contains the string that I want to extract from. So ideally the script would read each line of the coordinate file 45..78 90..120 etc and uses it in the extraction method file.readlines each do |l| puts string[l] end Doesnt work tho -any suggestions on how to pipe each line of the coordinate file to the string method? I know I know, probably simple, but I am still learning ;) Cheers, Marc -- Posted via http://www.ruby-forum.com/.