Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8521459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:49:53+00:00 2026-06-11T06:49:53+00:00

I am splitting up a comma delimited CSV-file by using this code below. It

  • 0

I am splitting up a comma delimited CSV-file by using
this code below. It works fine, but some of the records in
the file contains a comma within the data, even though comma is reserved
as the delimiter. For example a record contains a description text where the user
has entered commas and my script enterprets that like the record ends.
How can I somehow get over that?

Here’s an example of a line in my CSV-file. Please remark the empty records at the end of the lines can be witout the “” enclosing characters:

“1”,”34353434″,”Adam”,”Traxx”,”343″,”This man is the boss, please handle with respect”,””,,””,””,,”,””,”0″,,”

This is how I read and split:

Sub ReadOnlineExample()
Dim line_read As String
Dim tempfilename As String
Dim i As Integer
Dim rows_skipped As Integer
Dim line_split(0 To 125) As String
Dim MortalityRates(0 To 125) As Double

 tempfilename = "C:\MortalityRateTable.csv"
 Dim sr As New System.IO.StreamReader(tempfilename)

'Split the line into individual data
line_split = line_read.Split(",")

'Save the split data into an array
For i = 0 To UBound(line_split)
  MortalityRates(i) = line_split(i)
Next i

End Sub

Can anyone help? Maybe it’s just a simple solution I just can’t see 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:49:54+00:00Added an answer on June 11, 2026 at 6:49 am

    Use a proper CSV parser – File Helpers is a popular option.

    There is also a parser from Microsoft – in the Microsoft.VisualBasic.FileIO namespace, the TextFieldParser.

    These take care of the subtle aspects of CSV that most hand rolled solutions don’t consider until hitting an issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file that is really in csv format but is being handed
I am splitting off some of the code in my project into a separate
I have problem in splitting data. I have data as follows in CSV file:
So Im reading a csv file and splitting the string with , as the
I am reading from a comma seperated file and splitting the contents into an
Splitting up functions, into smaller sub function into the code, can effect efficiency of
I'm seeking a solution to splitting a string which contains text in the following
I have managed to split a CSV file based on the commas. I did
May be I am splitting hair, but I was wondering in the following case:
I am trying to read a file and hence I am splitting the fields

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.