Parsing text
- From: Cyril Jose <cyril_jose@xxxxxxxxx>
- Date: Thu, 21 Apr 2011 20:43:47 -0500
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/.
.
- Follow-Ups:
- Re: Parsing text
- From: Cyril Jose
- Re: Parsing text
- From: 7stud --
- Re: Parsing text
- From: John W Higgins
- Re: Parsing text
- Prev by Date: Is there any good Ruby GTK tutorial
- Next by Date: Re: Parsing text
- Previous by thread: Is there any good Ruby GTK tutorial
- Next by thread: Re: Parsing text
- Index(es):
Relevant Pages
|