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

  • Home
  • SEARCH
  • 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 5955439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:06:52+00:00 2026-05-22T18:06:52+00:00

So after doing some research I was able to find the format I need

  • 0

So after doing some research I was able to find the format I need to get the CSV File into

Subject,Start Date,Start Time,End Date,End Time,All Day Event,Description,Location,Private

The issue is, the CSV export I’m working with is not in the correct format or order, what is the best way to go about gathering that information? Here is a bit of my source.

Name,User Name,Row Type,Start Date,Start Time,End Time,End Date,Segment Start Date,Type

“Smith, John J”,jjs,Shift,5/29/2011,9:30,17:30,5/29/2011,5/29/2011,Regular

“Smith, John J”,jjs,Shift,5/30/2011,13:30,17:30,5/30/2011,5/30/2011,Regular

    Dim Name As String = ""
    Dim UserName As String = ""

    Dim Data As String = """Smith, John J"",jj802b,Shift,5/29/2011,9:30,17:30,5/29/2011,5/29/2011,Transfer"

    For r As Integer = 1 To 10
        Name = Data.Substring(0, Data.LastIndexOf(""""))
        Data = Data.Remove(0, Data.LastIndexOf(""""))
        UserName = Data.Substring(Data.LastIndexOf(""""), ",")
    Next
  • 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-05-22T18:06:53+00:00Added an answer on May 22, 2026 at 6:06 pm

    Following is the solution

    Dim Name As String = ""
    Dim UserName As String = ""
    
    Dim Data As String = """Smith, John J"",jj802b,Shift,5/29/2011,9:30,17:30,5/29/2011,5/29/2011,Transfer"
    
    For r As Integer = 1 To 10
        Dim DataArr() As String = DecodeCSV(Data) 'Use DecodeCSV function to regex split the string 
        Name = DataArr(0) 'Get First item of array as Name
        UserName = DataArr(1)  'Get Second item of array as UserName 
    Next
    

    Great Code for DecodeCSV by Tim

    Public Shared Function DecodeCSV(ByVal strLine As String) As String()
    
        Dim strPattern As String
        Dim objMatch As Match
    
        ' build a pattern
        strPattern = "^" ' anchor to start of the string
        strPattern += "(?:""(?<value>(?:""""|[^""\f\r])*)""|(?<value>[^,\f\r""]*))"
        strPattern += "(?:,(?:[ \t]*""(?<value>(?:""""|[^""\f\r])*)""|(?<value>[^,\f\r""]*)))*"
        strPattern += "$" ' anchor to the end of the string
    
        ' get the match
        objMatch = Regex.Match(strLine, strPattern)
    
        ' if RegEx match was ok
        If objMatch.Success Then
            Dim objGroup As Group = objMatch.Groups("value")
            Dim intCount As Integer = objGroup.Captures.Count
            Dim arrOutput(intCount - 1) As String
    
            ' transfer data to array
            For i As Integer = 0 To intCount - 1
                Dim objCapture As Capture = objGroup.Captures.Item(i)
                arrOutput(i) = objCapture.Value
    
                ' replace double-escaped quotes
                arrOutput(i) = arrOutput(i).Replace("""""", """")
            Next
    
            ' return the array
            Return arrOutput
        Else
            Throw New ApplicationException("Bad CSV line: " & strLine)
        End If
    
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After doing some research on this issue, I couldn't find any satisfying fix. The
I want to convert a string into a double and after doing some math
After doing some research I heard only PHP 5.3.6+ supports PDO and SSL. I
I have the following after doing some research on other questions: MyServiceHost: public class
After doing some work with Ruby, Rails, and RSpec last summer and I learned
I'm writing a wizard for an Eclipse RCP application. After doing some processing on
Alright, after doing a ton of research and trying almost every managed CPP Redist
I'm just getting back into C++ after a couple of years of doing a
So for some research work, I need to analyze a ton of raw movement
Context PHP 5.3.x Overview After doing a code-review with an associate who uses both

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.