Sorry if it should be obvious. How do I use this? I had a play and didn't get an echo to work to check I had it set up right or even begin to use the data. Do I need to link to any other files other than my csv?

thanks for the script. works great. here is a version adjusted to handle csv files with rows that have fewer columns than the header row. adds delimiter(s) to the end of shorter shows so the file can still be read.

If your file lacks a header row, here's a simple way to deal with either case. If there is a header row, leave the fieldnames parameter blank... if it lacks a header row, pass a comma-delimited list of field names.

@rboatright
I don't know why I didn't notice this before, but you aren't using the $delimiter passed as a parameter for the header columns. Wouldn't they usually be the same delimiter as the rest of the file?

Edit: Doh! I remember having thought about this last time. I see what it's doing now. I'm passing in the "headers" via string which is comma delimited. Thanks!