DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Load A CSV File

01.22.2006
| 3043 views |
  • submit to reddit
        
    read-csv: func [
        "Load and parse a delimited text file."
        file [file!]
        /with
            delimiter
        /local lines
    ][
        if not with [delimiter: ","]
        lines: read/lines file
        forall lines [
            change/only lines parse/all first lines delimiter
        ]
        ; head lines  ;<- needed for View < 1.3
    ]