C
Cyril Jose
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!
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!