我想要更改CSV和2个文件头。
"h1","h2","h3","h4"
"d1","d2","d3","d4"
csv = CSV.read(file,headers:true)
我怎样才能找到,例如" h3"并将其名称更改为" header3"?
答案 0 :(得分:0)
我找到了答案,为什么这不是CSV库中的功能;它可以用File和gsub来完成。
How to search file text for a pattern and replace it with a given value