From: Justin Collins Date: 2011-11-01T01:43:01+09:00 Subject: Re: Anything like FS in Ruby? On 10/31/2011 03:40 AM, Wayne Brissette wrote: > Coming over from AppleScript, one of the things I haven't been able to find is something like AppleScript's Text Item Delimiters or Awk's FS, where you can define separators for text files. For example, if I have something like this: > > 1 > 2 > > If I set FS to, then I could capture 1, and 2. > > While this isn't a great example because there are many other ways to capture this via regex. This becomes more useful with much more convoluted things. I haven't been able to find anything similar in Ruby, which probably means I need to rethink how I capture blocks of text and store them into arrays and hashes. > > Wayne I believe you are looking for $/ http://www.rubyholic.com/Languages/Ruby/QuickRef.html#19 Also, you can set the record separator when calling various methods like gets(): http://rubydoc.info/stdlib/core/1.9.2/IO:gets -Justin