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 9260643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:56:43+00:00 2026-06-18T12:56:43+00:00

I have two columns in a CSV file and I need to store each

  • 0

I have two columns in a CSV file and I need to store each column in a separate array.

Name,AvalibilityAsBoolean
---------------------------
Vagarth Gaurav,True
Dhananjay Menon,False

I would like to have one array for name, and another array for availability as a boolean value stored similar to below.

Name(0) = "Vagarth Gaurav"
Name(1) = "Dhananjay Menon"
Available(0) = True
Available(1) = False

The only problem is reading the CSV and storing the strings and booleans into the proper arrays.

Please help, I am new to VB. I am using Visual Basic 2010

  • 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-18T12:56:45+00:00Added an answer on June 18, 2026 at 12:56 pm

    I’m sure this question has been asked before, but this should help. Utilizing the TextFieldParser Class to do the parsing for you makes it easy. Code for managing the two arrays is displayed in this code example too.

        Dim arrName() As String
        Dim arrValue() As String
    
        Using ioReader As New Microsoft.VisualBasic.FileIO.TextFieldParser("C:\test\test.csv")
    
            ioReader.TextFieldType = FileIO.FieldType.Delimited
            ioReader.SetDelimiters(",")
    
            While Not ioReader.EndOfData
    
                Dim arrCurrentRow As String() = ioReader.ReadFields()
    
                If arrName Is Nothing Then
    
                    ReDim Preserve arrName(0)
                    ReDim Preserve arrValue(0)
    
                    arrName(0) = arrCurrentRow(0)
                    arrValue(0) = arrCurrentRow(1)
    
                Else
    
                    ReDim Preserve arrName(arrName.Length)
                    ReDim Preserve arrValue(arrValue.Length)
    
                    arrName((arrName.Length - 1)) = arrCurrentRow(0)
                    arrValue((arrValue.Length - 1)) = arrCurrentRow(1)
    
                End If
    
            End While
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have loaded a csv file into R with two columns (column A
I have two CSV files which use @ to divide each column. The first
I have a CSV file with two columns: cat @ c a t dog
I have two CSV files (three columns) which I need to compare and extract
I have two columns in a csv file, one of which has the time
I have a CSV file with two columns: city and zipcode. I want to
I have a CSV file with two different columns, one with PC names and
I have a csv file which has two columns, a numeric ID ( IDVAR
I have two columns. Column E extends up to 99504 (values) and column I
I have two columns, each with many rows/divs. I'm trying to get jQuery UI

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.