Hi!
Sorry for me, I’ve puted the lines what you wrote but it can be, that to
wrong place or something, because I can’t bring it to life. Would you
please look for it? Ive attach my script…
Regards:
Daniel
Hi!
Sorry for me, I’ve puted the lines what you wrote but it can be, that to
wrong place or something, because I can’t bring it to life. Would you
please look for it? Ive attach my script…
Regards:
Daniel
On Fri, 2006-03-17 at 20:54 +0900, Dani wrote:
Hi!
Sorry for me, I’ve puted the lines what you wrote but it can be, that to
wrong place or something, because I can’t bring it to life. Would you
please look for it? Ive attach my script…
If I had to do this quickly (and without too much thought) I’d do
something like this:
def process(text_data, &blk)
text_data.split(/^$/m).each do |e|
dta = e.strip.gsub(/;$/,’’).split(/\n/)
yield *(dta.slice!(0…5) + [dta])
end
end
Which you’d then use like this:
process(File.read(‘teszt.data’)) do |ny, ne, ados, adoa, to, ig,
columns|
puts “#{ny} :: #{ne} :: #{ados} :: #{adoa} :: #{to} :: #{ig}”
p columns
end
Obviously you’d change the output to suit your needs. Bear in mind I’ve
not extensively tested this…
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs