Hi, I am a newbie please be kind enough to help me.... I have XML like config file which looks like below. Code: <DATA> <NAME>Test</NAME> <DESTINATION>Save</DESTINATION> <PRINT-ERROR-PAGE>False</PRINT-ERROR-PAGE> </DATA> I have a parser which will parse and give me the values out of the above mentioned XML like config file What I need help is in creating function which will use that information to overwrite the information below shown file Code: _ErrorEnabled,_SupplementalJobAttributes#,true, So for example it should overwrite the information in above mention line as Code: _ErrorEnabled,_SupplementalJobAttributes#,false, Please note there are many lines of information like that I need to overwrite any help would be great as I have no idea to do this in a optimal fashion. Thanks in advance -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
This looks like a strictly Ruby question. I think you''ll get more response at comp.lang.ruby, http://groups.google.com/group/comp.lang.ruby hth, Bill --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
rubynewbie wrote:> Hi, > > I am a newbie please be kind enough to help me.... > > I have XML like config file which looks like below. >...> > What I need help is in creating function which will use that information > to overwrite the information below shown file > > Code: > > _ErrorEnabled,_SupplementalJobAttributes#,true, > > > > So for example it should overwrite the information in above mention line > as...> > any help would be great as I have no idea to do this in a optimal > fashion. > > Thanks in advanceI''m still a bit of a newbie myself. I''ve found that I get much better response to a question like: "I wrote the following code to do so and so, and I don''t understand why it doesn''t work..." or "Here is my code to do so and so, can anyone recommend a better way or suggest some optimizations?" rather than "please write my code for me." BTW, do you have the "pickaxe ruby book" by Dave Thomas? I strongly recommend spending some time with that before trying to do any big Ruby stuff in your Rails app. You need to become well versed in regular expressions and gsub and the file related bits in Ruby to tackle the job you describe here. Also look into the Rexml library described in the above book. best, jp -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---