- The problem is that fasterCSV read the file before it´s been converted
with the " char.
- The second problem that I have with Rails is that åäö letters doesn´t
been imported correctly even when I use the $KCODE = "utf8" code.
- The problem is that fasterCSV read the file before it´s been converted
with the " char.
If you're using a CSV parser and you are having to manually translate the quote, the data probably isn't really CSV data. If you just have a bunch of fields separated by comma (and they may have quotes in them), you don't need a CSV parser at all:
fields = line.split(",")
To answer your question though, you can remove quotes with:
line.delete!('"')
- The second problem that I have with Rails is that åäö letters doesn´t
been imported correctly even when I use the $KCODE = "utf8" code.
Check to be sure that the file data actually is UTF-8 encoded and that your database tables are setup for that encoding.
Thanks for your answer. It should be very easy to import this file. The
columns are separated with TAB and the lines with \n .
I have changed my code to the following, but not working... (I´m a
newbie):