Parsing CSV file?

Not working here either - Ventura OS, Brave Web Browser, VPN

Be sure you’re accessing the http link, it worked just fine here when I noticed what was going on.

Browsers or plugins that force https will have trouble because this is hosted on Dreamhost who sets up a “not configured” page with a self signed certificate. Modern browsers don’t like that.

<plug for a super great app that helps you set up your own website and manages https for you>

3 Likes

The link is an http link so most likely your browser is blocking the download.

Copy the link, and paste directly to your browser window.

Edit: Tim beat me with the http/https info.

Norm’s CSVParser generally works well but it seems to miss the last line of the CSV files I need to parse. They come from Google’s Looker Studio and the last line is not terminated with any kind of line ending characters, the file just ends and CSVParser does not fire the HandleLine event for that last line.

Has anyone modified CSVparser so it handles the last line when it encounters the End of File?

Is this thing reading line by line from the file or reading in the whole file and then processing it? If the latter, could check whether the file is terminated by an EndOf Line and add one if not.

Or just add your own EndOfLine to the data all the time before passing to CSVParser, if your other processing ignores empty lines.

Hi Tim

I currently pass a folderitem to CSVParser and let it read the file itself. I’ve used the debugger to verify the whole file is read and it even parses that last line. But when it hits EoF before finding an end of line it exits and doesn’t raise the HandleLine event to pass out the parsed data.

I’ve considered adding code to check for a line ending and modify the file, but that seems like a bandaid and I was hoping someone may have already fixed the root issue.

RFC-4180 the CSV file format specification says it’s optional to have a line ending at the end of file.

The last record in the file may or may not have an ending line
       break.  For example:

       aaa,bbb,ccc CRLF
       zzz,yyy,xxx

FYI I decided to use Christian’s SplitCommaSeparatedValuesMBS function instead. It’s very simple and easy to use, and handles the EoF issue well.