|
-
Mar 30th, 2007, 10:19 AM
#1
Thread Starter
PowerPoster
[RESOLVED] Receiving quotation marks from a .CSV file???
I'm getting some weird input in my VB.Net 2005 program. I am reading a .CSV file as input and parsing the fields. When I look at the raw file, there are no quotation marks in the file, however, when I parse an Address field, it places quotation marks around the value and I'm not sure why it's doing that. It does it for 3 other fields that basically contain city, state, zip. None of these values in the .CSV file have quotes around them. Here is the code I use to retrieve the data.
Code:
Dim arrLine(16) As String
F1 = System.IO.File.OpenText(Trim(txtTransmissionFileName.Text))
Do While Not F1.EndOfStream
strLine = F1.ReadLine
arrLine = Split(strLine, ",")
stcInput.custNO = Trim(arrLine(0))
stcInput.custLocNO = Trim(arrLine(1))
stcInput.invoiceNO = Trim(arrLine(2))
stcInput.invoiceDate = Trim(arrLine(3))
stcInput.truckID = Trim(arrLine(4))
stcInput.transDateTime = Trim(arrLine(5))
stcInput.custLocAddr = Trim(arrLine(6))
stcInput.custLocCity = Trim(arrLine(7))
stcInput.custLocState = Trim(arrLine(8))
stcInput.custLocZip = Trim(arrLine(9))
stcInput.prodDesc = Trim(arrLine(10))
stcInput.gallons = Trim(arrLine(11))
stcInput.prodPrice = Trim(arrLine(12))
stcInput.taxPerGallon = Trim(arrLine(13))
stcInput.transTotAmt = Trim(arrLine(14))
stcInput.fedExciseTax = Trim(arrLine(15))
stcInput.stateExciseTax = Trim(arrLine(16))
stcInput.miscTaxes = Trim(arrLine(17))
stcInput.salesTax = Trim(arrLine(18))
stcInput.prodCD = Trim(arrLine(19))
Loop
The lines in red are inserting quotation marks. Here is what the data looks like:
""12460 MAR VISTA DRIVE""
""DAYTON""
""OH""
""CLR CARB ULS #2""
Any ideas what is causing this?
Thanks,
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
|