read

read(path, *options)
Class Public methods

Use to slurp a CSV file into an Array of Arrays. Pass the path to the file and any options ::new understands. This method also understands an additional :encoding parameter that you can use to specify the Encoding of the data in the file to be read. You must provide this unless your data is in Encoding.default_external. CSV will use this to determine how to parse the data. You may provide a second Encoding to have the data transcoded as it is read. For example, encoding: "UTF-32BE:UTF-8" would read UTF-32BE data from the file but transcode it to UTF-8 before CSV parses it.

doc_ruby_on_rails
2015-04-01 22:18:29
Comments
Leave a Comment

Please login to continue.