in a CSV string is there a way to know how many delimiters there are
in a CSV string is there a way to know how many delimiters there are
for example
first,last,address,city
is there a way to know how many , are in the above string
Re: in a CSV string is there a way to know how many delimiters there are
If there are commas nested in " then you can use Ubound(Split()) + 1 on one line to get column count.
You can also treat the CSV as an ADO datasource with appropriate connection string. http://www.carlprothman.net/Default.aspx?tabid=81 The connected ADO recordset object will have field count property.
Re: in a CSV string is there a way to know how many delimiters there are
Code:
Const TEST = "one,two,three"
MsgBox Len(TEST) - Len(Replace(TEST, ",", ""))