LanX has already given some good answers, so I'll just add that I'd advise against trying to do your own CSV handling. Use Text:CSV - it'll gracefully handle files that a naive approach WILL get wrong. Don't reinvent the wheel without a compelling reason.