CSV again.

Richard Gaskin ambassador at fourthworld.com
Thu Oct 15 22:28:39 EDT 2015


Mike Kerner wrote:

> csv4 does not handle it, and it comes up with a different result from csv2
> (which is also wrong).  I sent Richard proposed changes to csv2 which
> addresses that issue, but I'll wait while we collectively try to remember
> what the latest and greatest csv parser algorithm is before I try to come
> up with more ways to break or fix it.

If the fix you provided addresses the issues you found it would be 
helpful to post it here so others can test it.

There was a naming issue in previous versions I'd like to address here:

The function named "CSV2Tab" uses a naming convention popular among some 
Pascal programmers back in the day (but apparently less common today), 
in which conversion functions use a numeral "2" instead of "to" to more 
readily distinguish the text on either side.

Along the way it seems some believed it was a version number embedded in 
the middle of the function name, and during our discussion we started 
seeing things like "CSV3Tab", "CSV4Tab", etc.

The version at my page may well be what was originally named "CSV4Tab", 
but renamed once it became the final version when I posted it to my 
site.  To the best of my knowledge the version posted on my page was the 
most robust available at the time I posted it.

Making things even more confusing, I believe there were at least two 
versions named "CSV4Tab", so I believe it may take some digging to find 
the latest and greatest.  And keep in mind that given the many weird 
things about the many very different implementations of CSV, the latest 
may not be the greatest.

A few years ago I stopped using the older "2" convention for converters, 
so no hand-slapping needed; already did it myself.  And I've never 
embedded a version number in a handler name except during testing, so if 
you ever see code from me that has a numeral in it rest assured it's not 
a version number; if it's meaning is unclear feel free to ask.


So all that said, two notes going forward:

1. When we get a good CSV algo here, the version I post at my page will 
be named "CSVToTab" to avoid such misunderstandings in the future.

2. While we're experimenting here perhaps we could add a version number 
at the end of the function name if it needs to be distinguished for 
comparison purposes (e.g., "CSVtoTab5").

I'll wait to update the page until we have a good one, and when I'll 
also provide a link back to the source post for reference.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list