csv to dataset c#
C#
public static DataTable ConvertCSVtoDataTable(string strFilePath) { StreamReader sr = new StreamReader(strFilePath); string[] headers = sr.ReadLine().Split(','); DataTable dt = new DataTable(); foreach (string header in headers) { dt.Columns.Add(header); } while (!sr.EndOfStream) { string[] rows = Regex.Split(sr.ReadLine(), ",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)"); DataRow dr = dt.NewRow(); for (int i = 0; i < headers.Length; i++) { dr[i] = rows[i]; } dt.Rows.Add(dr); } return dt; } static void Main(string[] args){ string filepath = "d://ConvertedFile.csv"; DataTable res = ConvertCSVtoDataTable(filepath);}
Also in C#:
- Title
- ionic build
- Category
- C#
- Title
- unity onclick object
- Category
- C#
- Title
- c# exit for
- Category
- C#
- Title
- unity method on scene loaded
- Category
- C#
- Title
- doest all the methos in interface need to implement c#
- Category
- C#
- Title
- remove from list based on condition c#
- Category
- C#
- Title
- JavaScriptSerializer() and convert to base64
- Category
- C#
- Title
- unity print
- Category
- C#
- Title
- vb.net yes no cancel
- Category
- C#
- Title
- lat long data type c#
- Category
- C#
- Title
- vector between two points unity
- Category
- C#
- Title
- stop unity editor playing
- Category
- C#
- Title
- iterate through dictionary c#
- Category
- C#
- Title
- unity rotation
- Category
- C#
- Title
- how to make an array in csharp
- Category
- C#
- Title
- setting the parent of a transform which resides in a prefab
- Category
- C#
- Title
- start up file in asp.net core
- Category
- C#
- Title
- vb.net check if datatable has rows
- Category
- C#
- Title
- c# string to datetime
- Category
- C#
- Title
- c# merge two xml files
- Category
- C#
- Title
- how does Pow work C#
- Category
- C#
- Title
- change canvas color uwp c#
- Category
- C#
- Title
- random class
- Category
- C#
- Title
- print gridcontrol devexpress
- Category
- C#
- Title
- c# list append
- Category
- C#
- Title
- unity3d get component
- Category
- C#
- Title
- waitforseconds unity
- Category
- C#
- Title
- how to track a branch on github
- Category
- C#
- Title
- no overload for 'useItemOnSceneLoad' matches delegate 'UnityAction<Scene, LoadSceneMode>'
- Category
- C#
- Title
- c# format string to date yyyymmdd
- Category
- C#
- Title
- c# close window
- Category
- C#
- Title
- c# linq join multiple conditions
- Category
- C#
- Title
- c# enum to int array
- Category
- C#
- Title
- c# regex replace
- Category
- C#
- Title
- c# asp.net hover tooltip
- Category
- C#
- Title
- unity up arrow input
- Category
- C#
- Title
- remove all array elements c#
- Category
- C#
- Title
- get and set for array c#
- Category
- C#
- Title
- c# bool list count true
- Category
- C#
- Title
- c# escape characters
- Category
- C#
- Title
- unity while in trigger
- Category
- C#
- Title
- c# error "The name 'ViewBag' does not exist in the current context"
- Category
- C#
- Title
- iformfile blobclient
- Category
- C#
- Title
- docker ssh
- Category
- C#
- Title
- C# get all files in directory
- Category
- C#
- Title
- the request was aborted could not create ssl/tls secure channel. c# restsharp
- Category
- C#
- Title
- unity3d raycast
- Category
- C#
- Title
- how to put double quotes in a string c#
- Category
- C#
- Title
- multidimensional meaning
- Category
- C#
- Title
- how to create a variable in C#
- Category
- C#
- Title
- for each line in string c#
- Category
- C#
- Title
- how to check if textbox is empty in c#
- Category
- C#
- Title
- how to print statement in c#
- Category
- C#
- Title
- vector3.lerp
- Category
- C#
- Title
- how to reference the position of a game object unity
- Category
- C#
- Title
- microsoft.portable.csharp.targets was not found vs 2019
- Category
- C#
- Title
- how to clear console through script unity
- Category
- C#
- Title
- .net core get image from url
- Category
- C#
- Title
- c# sort array string by length
- Category
- C#
- Title
- unity load scene
- Category
- C#
- Title
- change textbox location C#
- Category
- C#
- Title
- c# while loop
- Category
- C#
- Title
- unity how to change max fps
- Category
- C#
- Title
- unity transfoprm position y change
- Category
- C#
- Title
- How to make a function in C#
- Category
- C#
- Title
- max of array C#
- Category
- C#
- Title
- how to set a gizmo color unity
- Category
- C#
- Title
- how to reference a transform unity
- Category
- C#
- Title
- center an image horizontally and vertically
- Category
- C#
- Title
- get what week of the month c#
- Category
- C#
- Title
- format float to time c#
- Category
- C#
- Title
- MVC company assignments
- Category
- C#
- Title
- convert array object to int[] c#
- Category
- C#
- Title
- unity docs player input
- Category
- C#
- Title
- unity how to change the text on a button
- Category
- C#
- Title
- while loop c#
- Category
- C#
- Title
- c# instantiate
- Category
- C#
- Title
- c# loop through two dimensional array
- Category
- C#
- Title
- c# make request to rest api
- Category
- C#
- Title
- .net core check if linux
- Category
- C#
- Title
- unity detect any key
- Category
- C#
- Title
- linq c# object except two lists
- Category
- C#
- Title
- c sharp exit while loop
- Category
- C#
- Title
- c# request run as administrator
- Category
- C#
- Title
- c# cancellationtoken
- Category
- C#
- Title
- unity onselect gizmos wireframe
- Category
- C#
- Title
- c# check to see if dictionary key exists
- Category
- C#
- Title
- dictionary update c#
- Category
- C#
- Title
- c# date
- Category
- C#
- Title
- add variable to the beginning of a list c#
- Category
- C#
- Title
- if statement conditions c#
- Category
- C#
- Title
- c#if
- Category
- C#
- Title
- unity check if gameobject is active
- Category
- C#
- Title
- c# window instantly close
- Category
- C#
- Title
- c# how to take from a float
- Category
- C#
- Title
- c# sort array
- Category
- C#
- Title
- double tryparse dot comma
- Category
- C#
- Title
- image filter
- Category
- C#
- Title
- how to add system.messaging c#
- Category
- C#
- Title
- kotlin random number
- Category
- C#