#!/usr/bin/ruby require "ftools" if ARGV.length<2 then puts "Argumets: [input file] [output file]" puts " It is presumed that the data file has the columns: x y f(x,y)" puts " Cycles through y values go in the inner loop." exit end # Read inn and interpret arguments fname_in=ARGV[0] fname_out=ARGV[1] c1="" fout=File.open(fname_out,"w") File.open(fname_in) {|fin| while (line=fin.gets) != nil sl=line.split(' ') if c1!=sl[0] && c1!="" then fout.write("\r\n") end c1=sl[0] #puts c1 fout.write("#{sl[2]} ") end } fout.close