I'm starting to play with this a little and I'm seeing problems already.

1. The ideal way (IMO) to read a CSV file would be to read the entire file into a string, then parse the string character-by-character. (This would be drastically faster than reading a file byte-by-byte.) In VBScript this would be no problem as a string may contain 2^31 characters.

This makes reading a file byte-by-byte likely the best option.

2. Processing X records with Y fields each really lends itself to a recursive function. That said, I hate writing/debugging recursive code. I'm going to avoid that for now... but this is where really good scripters can shine.

3. The potential for embedded new lines and quotes within a field makes this a real bear.

4. For now, I'm just playing with a CSV(File, optional Array) UDF. Whether or not an optional array of data is supplied as the second parameter controls whether it reads or writes CSV data.

NMM