From: cristian cristian Date: 2012-04-19T05:22:09+09:00 Subject: Re: Converting CSV Jan E. wrote in post #1057244: > Well, parsing the file and processing its content is certainly more > difficult than doing search and replace. > > File.open 'myfile.csv', 'r+' do |csv| > new_csv = csv.read.gsub(/[^\n\r;]+/, '"\0"').gsub(';', ',') > csv.print new_csv > end > > This quotes everything between the semicolons and then replaces them > with commas. Ok, thanks! Will this save the new file with the name "new_csv"? Br cristian -- Posted via http://www.ruby-forum.com/.