D
Dani
Hi everyone!
I need a little help. I have a script for ruby:
outfile =3D ARGV.shift
lines =3D ARGF.readlines
marked_up_lines =3D lines.map do |line|
words =3D line.split
'<mezo eazon=3D"' + words[0] + '">' + words[1] + '</mezo>' + "\n"
end
File.open(outfile,'w') do |file|
file.write marked_up_lines.join
end
This script should split two words with special parameter (from a plain
text it makes xml source). That works so fine if I have ONLY two
columns, but if I put several lines in the txt file beginning it dies.
So, my only question is: how can I bring ruby that it should from line
nr. X (i.e. 6 or 7) begin? And another question: can ruby after the
conversion put in the file a line (ie. </end>)?
Thanks, regards:
Daniel
(e-mail address removed)
I need a little help. I have a script for ruby:
outfile =3D ARGV.shift
lines =3D ARGF.readlines
marked_up_lines =3D lines.map do |line|
words =3D line.split
'<mezo eazon=3D"' + words[0] + '">' + words[1] + '</mezo>' + "\n"
end
File.open(outfile,'w') do |file|
file.write marked_up_lines.join
end
This script should split two words with special parameter (from a plain
text it makes xml source). That works so fine if I have ONLY two
columns, but if I put several lines in the txt file beginning it dies.
So, my only question is: how can I bring ruby that it should from line
nr. X (i.e. 6 or 7) begin? And another question: can ruby after the
conversion put in the file a line (ie. </end>)?
Thanks, regards:
Daniel
(e-mail address removed)