I'm trying to use square brackets '[]' as a row separator in a CSV file. I must use this exact format for this project (output needs to match LEDES98 law invoicing format exactly).
I'm trying to do this:
CSV.open('output.txt', 'w', col_sep: '|', row_sep: '[]') do |csv|
#Do Stuff
end
But Ruby won't take row_sep: '[]'
and throws this error:
lib/ruby/1.9.1/csv.rb:2309:in `initialize': empty char-class: /[]\z/ (RegexpError)
I've tried escaping the characters with /'s, using double quotes, etc, but nothing has worked yet. What's the way to do this?