Newby question

How do I get each key (they are words /strings) to output on a new line in
this example?

File::open(title + '.htm', 'w') do |f|
hash.keys.each {|s| f.puts s}
......other stuff
end

-this results in all keys on one line

I've tried:
dict.keys.each {|s| f.puts s "\n"}
dict.keys.each {|s| f.puts s"\n"}
dict.keys.each {|s| f.puts ("#{s} \n"}
dict.keys.each {|s| f.puts s + " \n"}
dict.keys.each {|s| f.puts s + '\n'}
dict.keys.each {|s| f.puts s + \n}
etc ad nauseum

Sorry for asking such a simplistic question....

CLS

Since it looks like you are trying to output an html file maybe replace the "\n" with "<br/>" or surround the entire block of test in
<pre></pre> tags might work?

ยทยทยท

On Jun 17, 2005, at 6:50 PM, Charles L. Snyder wrote:

How do I get each key (they are words /strings) to output on a new line in
this example?

File::open(title + '.htm', 'w') do |f|
hash.keys.each {|s| f.puts s}
......other stuff
end

-this results in all keys on one line

I've tried:
dict.keys.each {|s| f.puts s "\n"}
dict.keys.each {|s| f.puts s"\n"}
dict.keys.each {|s| f.puts ("#{s} \n"}
dict.keys.each {|s| f.puts s + " \n"}
dict.keys.each {|s| f.puts s + '\n'}
dict.keys.each {|s| f.puts s + \n}
etc ad nauseum

Sorry for asking such a simplistic question....

CLS

-Ezra Zygmuntowicz
WebMaster
Yakima Herald-Republic Newspaper
ezra@yakima-herald.com
509-577-7732

Doh...
That was it!
Thank you - I forgot the output was .htm.....
'purloined letter syndrome"