You can use ruby''s IO library to read the contents of a file into a
string, or cycle through by lines, or what have you. See:
http://www.ruby-doc.org/core/classes/IO.html
HTH,
-Roy
-----Original Message-----
From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
[mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of
Zeeshan Haq
Sent: Thursday, June 05, 2008 8:06 AM
To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: [Rails] word replacement from the file
hello,
I need little help from you that i want to replace word/s from a .rb and
.txt file. I am using the ''gsub'' function for replacing the
word from
the string but i am not able to replace word/s from a file (.rb and
.txt).
I will be very kind and thnkful to you if you could resolve my problem,
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---