README.md

December 4, 2022 ยท View on GitHub

CSV string parser

Description

This function takes a comma separated string and parses the values into a variable-length array, which can then be assigned to a predefined number of variables, or iterated with a For-Next loop. This code is roughly based on Brant Gluth's submission entitled "Parse Delimited Text", with the addition of a demo form and improved string handling. Most noticeably, this code can handle strings enclosed in quotes and will not break on delimiter characters within the quotes.

More Info

strSource - string containing CSV text.

strDelimiter - optional string value representing the delimiter, default is a comma.

strQuote - optional string value representing the quotation mark character, default is ".

All you need to implement this code in your own program is the module "readcsv.bas".

variable-length variant array containing each field from the CSV line.

None. Does not crash when given an empty string or improperly formatted text.

Submitted On2003-04-25 09:56:20
ByMike Baldwin
LevelIntermediate
User Rating4.8 (19 globes from 4 users)
CompatibilityVB 6.0
CategoryString Manipulation
WorldVisual Basic
Archive FileCSV_string1579344252003.zip