|
-
Jun 4th, 2003, 12:46 PM
#1
Thread Starter
New Member
VB Split Function
Hello all-
I have a split function for seperating out a csv formatted text file. (Fields seperated by commas with Double Quotes around text). The issue is that many of the fields have descriptive text where someone uses a comma. How do I make sure the split function ignores those commas?
-----Code that does the initial split
aTmp = Split(aData(b), chr(44))
-----Code that runs the sql string and gets rid of the double quotes.
sValueList = sValueList & ", " & SQLString(aTmp(aFieldPositionList(c) - 1))
-----Function being called above
function SQLString(sString)
sTmp = Trim(sString)
if Len(sTmp) then
SQLString = "'" & Replace(Replace(sTmp, chr(34), ""), "'", "''") & "'"
else
SQLString = "null"
end if
end function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|