Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!weretis.net!feeder4.news.weretis.net!news.cgarbs.de!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!talisker.lacave.net!lacave.net!not-for-mail From: Cyril Jose Newsgroups: comp.lang.ruby Subject: Parsing text Date: Thu, 21 Apr 2011 20:43:47 -0500 Organization: Service de news de lacave.net Lines: 17 Message-ID: <75e6c383a0a6a5d072fdbe3ba9a7ceb5@ruby-forum.com> NNTP-Posting-Host: bristol.highgroove.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: talisker.lacave.net 1303436640 23203 65.111.164.187 (22 Apr 2011 01:44:00 GMT) X-Complaints-To: abuse@lacave.net NNTP-Posting-Date: Fri, 22 Apr 2011 01:44:00 +0000 (UTC) X-Received-From: This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway X-Mail-Count: 382038 X-Ml-Name: ruby-talk X-Rubymirror: Yes X-Ruby-Talk: <75e6c383a0a6a5d072fdbe3ba9a7ceb5@ruby-forum.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.ruby:3351 Hey all, I have a file where I need to parse information from. The format of the first line is something like this: ">ruby ruby |ruby|ruby ruby|text_i_want| test test" I was thinking converting this line into an array, using the .split(//) and keeping count of the pipe("|") character so that when it reaches the 3rd one, it reads the characters up till the 4th pipe(all in a do iterator. So in essence, I would want to extract "text_i_want". When i tried this method, I got stuck. Any ideas on how to move forward? Or an easier solution than this? Thanks! -- Posted via http://www.ruby-forum.com/.