require 'pp'
DATA.each do |line |
line =~/(\d+,\d+)\s+(.*)/
value= $1.gsub(",",'')
#pp $1
puts $2,9.chr,value
end
__END__
55,356 q1.txt
58,688 q2.txt
65,791 q3.txt
70,185 q4.txt
84,533 q5.txt
104,454 q6.txt
121,827 q7.txt
142,584 q8.txt
187,097 q9.txt
253,817 q10.txt
替换的地方如果用了 gsub 就会覆盖掉原来的$n 怎么样实现只是原样替换,不用正则