You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
626 B
Ruby

#lss_builder.rb
#just make a list of names
#and a list of times
#
#make sure they have the same
#number of lines
#maybe ill make a splits editor sometime
def wrap(tag, str)
return "<#{tag}>#{str}</#{tag}>"
end
name_lines = File.readlines("splits.txt")
time_lines = File.readlines("times.txt")
both = name_lines.zip(time_lines)
print both
out = both.map { |x|
realtime = wrap("RealTime", x[1].strip)
splittime = wrap("SplitTime", realtime)
splittimes = wrap("SplitTimes", splittime)
name_tag = wrap("Name", x[0].strip)
segment_tag = wrap("Segment", name_tag + splittimes)
}
File.write("output.txt", out.join(""))