prashanth hiremath wrote:
> My requirement is  i have to put .csv file into elements of array so 
> that i
> can increment longitude and latitude values for compraion if it matches
> 
> then i have to pull the entire row from the file this is the problem am
> facing
> 

Let me see if I understand what you're saying:
1. You have to read each row of file to get the lat / long to compare
2. Then compare the lat / long to something else to see if its the 
record you want
3. If so, you need to read the whole record

Well, to get to the lat / long (fields 6 and 7 out of 8), you have to 
have read the row anyway, so it seems that your solution should be to

Read the file and for each line
   parse the line
   test the lat / long
   if its what you're looking for, keep that row (you've already read 
it)
   otherwise throw it away

Are you expecting a single match for a lat / long, or could there be 
multiple rows that meet your "match" criteria?  This serves just as an 
efficiency measure.  If you're only supposed to find a single match, 
once you've found it, you're done.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to