Parsing and ovewriting a comma delimated file

Hi,

I am a newbie please be kind enough to help me…

I have XML like config file which looks like below.

Code:

Test Save False

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

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 advance

I’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 T.? 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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs