Space Index by yamaken

a = []
readlines.each do |i|
ar = i.split(' ')
if ar[0]
t = 0
ar[0].split(',').each do |r|
ar[1].insert(r.to_i+t, ' ') if ar[1]
t=t+1
end
ar[1] = ar[0] if !ar[1]
else
ar[1] = i.strip
end
a << ar[1] || ''
end
puts a.join("\n")

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top