Read CSV C# - Write CSV C# [C# CsvHelper] - C# CSV Parser - Read/Write CSV Files in C#

  Рет қаралды 29,319

Coding Droplets

Coding Droplets

Күн бұрын

Пікірлер: 48
@CodingDroplets
@CodingDroplets 3 жыл бұрын
Thank You all for watching this video. Subscribe: kzbin.info/door/JCZJpOAWaAGTyqtESnwwSQ Follow Coding Droplets: Facebook: facebook.com/codingdroplets Twitter: twitter.com/codingdroplets Instagram: instagram.com/codingdropl... Github: github.com/codingdroplets/
@glitterkommando2060
@glitterkommando2060 Жыл бұрын
Cannot even thank you enough how much this cleared this whole issue for me. Mad respect.
@CodingDroplets
@CodingDroplets Жыл бұрын
Thank you so much for your kind words! I'm glad to hear that the video was able to clear up any confusion you had and that it was helpful to you.
@tewodrosgirma
@tewodrosgirma 2 жыл бұрын
Your presentation is so clear. Thank you.
@CodingDroplets
@CodingDroplets 2 жыл бұрын
Most Welcome! Thank you for your feedback.
@ti_doo
@ti_doo 2 жыл бұрын
Best video explaining very simple how its done. Thank you very much
@CodingDroplets
@CodingDroplets 2 жыл бұрын
You are welcome. Thank you for sharing your thoughts.
@nakorns320
@nakorns320 Жыл бұрын
Thank you for yours tutorial and example , it helpful me.
@CodingDroplets
@CodingDroplets Жыл бұрын
You're welcome! Glad to know it helped.
@jonlbs7
@jonlbs7 2 жыл бұрын
Wonderful.. Thank you. Your tutorials are excellent.. 👍👍👍👍😊😊
@CodingDroplets
@CodingDroplets 2 жыл бұрын
You are welcome. Thank You for sharing your thoughts!
@bengraham1798
@bengraham1798 Жыл бұрын
Thank you, great video 😊
@CodingDroplets
@CodingDroplets Жыл бұрын
You’re welcome 😊
@deep2peak108
@deep2peak108 2 жыл бұрын
keep it up bro it's rally helpful
@CodingDroplets
@CodingDroplets 2 жыл бұрын
Thank you! Glad to know that it helped.
@charudattabangal5123
@charudattabangal5123 Жыл бұрын
The CSV that I have contains scientific notations, so is there any way to remove those notations and read the exact value from the cell? Or can we change the data type of a column using LinqToCsv?
@CodingDroplets
@CodingDroplets Жыл бұрын
Thank you for reaching out! In order to provide you with a more accurate solution, it would be helpful to see the structure and content of your CSV file. This will allow me to better understand the specific requirements and provide you with the appropriate guidance. Could you please share a sample of your CSV file or provide more details about its structure and the specific columns you are working with? With that information, I'll be able to assist you in removing scientific notations and changing the data type of a column using the LinqToCsv library. Once I have a better understanding of your CSV file, I'll be able to provide you with a more tailored solution. Thank you!
@charudattabangal5123
@charudattabangal5123 Жыл бұрын
@@CodingDroplets Thankyou very much for the reply Where can I share you my csv?
@paulauy4508
@paulauy4508 2 жыл бұрын
what if I want to use parser, then the csv that was read would be import to a certain database ? is it possible ?
@CodingDroplets
@CodingDroplets 2 жыл бұрын
Yes. It is possible. First you can parse CSV file to list of objects. Then just insert those to your database.
@pirnadi
@pirnadi 2 жыл бұрын
So now my question is Is it possible, when reading CSV file content, we replace reading directly from physical file to reading from stream object instead? The code fragment may look something like this IBrowserFile _file; ... var stream = _file.OpenReadStream(); var countries = csvContext.ReadFromStream(stream, csvFileDescription);
@CodingDroplets
@CodingDroplets 2 жыл бұрын
I think the library which we used in this video is not having such kind of method. But you can create an extension method like that and from that method you can use this library.
@sadiqsyed7351
@sadiqsyed7351 2 жыл бұрын
Hey, nice video and explanation. But can u please make another video which contains string, integer, float, etc. Along with mathematical manipulation loke mean, median etc.
@CodingDroplets
@CodingDroplets 2 жыл бұрын
Will do a video soon
@ashotjanibekyan4163
@ashotjanibekyan4163 2 жыл бұрын
Now I understand why we use Python for ML. Just pd.read_csv('path')
@CodingDroplets
@CodingDroplets 2 жыл бұрын
Hope you are using python pandas library.
@sangnguyenn2367
@sangnguyenn2367 2 жыл бұрын
Thank you
@CodingDroplets
@CodingDroplets 2 жыл бұрын
Welcome!
@yashwanthmadhini9467
@yashwanthmadhini9467 2 жыл бұрын
Hi nice tutorial, How can i populate all the records in csv as a list object ?
@CodingDroplets
@CodingDroplets 2 жыл бұрын
Hi. In the video itself we are showing a demo of reading a csv file which contains a list of countries. The data will be populated to a list of Country objects.
@MatasangaX
@MatasangaX 2 жыл бұрын
how to add row and delete spesific row?
@CodingDroplets
@CodingDroplets 2 жыл бұрын
The data read from CSV file will be a list of objects. You can use RemoveAt method if you know the object index. Also you can use RemoveAll method to provide a condition and remove all objects that matches the condition.
@MatasangaX
@MatasangaX 2 жыл бұрын
@@CodingDroplets any example for doing that? and how to add/append row? (not overwrite file)
@CodingDroplets
@CodingDroplets 2 жыл бұрын
kzbin.info/www/bejne/jmeuh2utYp6Ed9E
@anjusm6053
@anjusm6053 2 жыл бұрын
im not able to find LinqToCsv file to install could you plss reply me??
@CodingDroplets
@CodingDroplets 2 жыл бұрын
You can install it from Nuget Packages. www.nuget.org/packages/LINQtoCSV
@Gmaaa
@Gmaaa 2 жыл бұрын
Hi my register is ;...;"name "mr" robot"; ...; double quote is erros. How do I adjust to not give an error with this double quote?
@CodingDroplets
@CodingDroplets 2 жыл бұрын
Is it possible to share a sample CSV file?
@produccionesjym4091
@produccionesjym4091 2 жыл бұрын
Hi, great video, I'm in the middle of a project and I'm using this as a guide to read a csv, I'm just wondering, where the data is stored? I understand that this code creates a sort of "country" objects, but I don't understand where is the "array" of countries, because I need to return those items to de main program and do other things with the data rather than print them on the console, I wonder if I can declare de ReadCsvFile method like "private static *country ReadCvsFile();" or something like that, is the variable "countries" an array of "country" type objects? If so, can I return "countries" variable to the main progam? Thank you very much, I'm just getting started in C# and came from C++ and I'm struggling with somethings.
@CodingDroplets
@CodingDroplets 2 жыл бұрын
You are right. The 'countries' variable is the array of 'Country' object. You can use that in your main program. The below line of code is reading content from CSV and populating the 'countries' variable. var countries = csvContext.Read("FILE_NAME", csvFileDescription);
@produccionesjym4091
@produccionesjym4091 2 жыл бұрын
@@CodingDroplets Thank you very much, it works perfectly with string objects, but I'm getting in trouble on this, hope you can help. Because in the class I need to declare de atributes as integers or doubles, and I have some null strings in the csv (which contains 6000+ rows), I need to assign a zero if the column has nothing (has only two separators toguether), if I dont do that, when the program wants to parse yo an integer I get an error, do you know if I can modify certain value before CSV HELPER parse and asign the null value or if there is a way to specify put a zero if the column value==nul???? thanks , greets from mexico.
@CodingDroplets
@CodingDroplets 2 жыл бұрын
You can use nullable integer (int?) datatype or nullable double (double?) datatypes. Just provide a question mark along with the datatype (int & double). That will make the property nullable. Eg: public int? ProductCode { get; set; }
@produccionesjym4091
@produccionesjym4091 2 жыл бұрын
@@CodingDroplets thank you very much for your help, that solved the problem, have a nice day.
@CodingDroplets
@CodingDroplets 2 жыл бұрын
You are most welcome! Glad to know it helped.
@tanyasingh8096
@tanyasingh8096 Жыл бұрын
I have to 6,28,000 data. So, how much time it will take for converting dataset into csv file?
@CodingDroplets
@CodingDroplets Жыл бұрын
Thank you for watching the tutorial and for your question. The time it takes to convert a dataset with 628,000 records into a CSV file can vary depending on various factors such as the performance of your system, the complexity of the data, and the efficiency of your code implementation. I recommend testing the conversion process on a smaller subset of your data first to get an estimate of the time it takes. This will give you an idea of the performance and scalability of your code.
@tanyasingh8096
@tanyasingh8096 Жыл бұрын
@@CodingDroplets for me it is taking 2-3 mins to download the data, can you please suggest a optimized method to convert dataset into CSV cell
@CodingDroplets
@CodingDroplets Жыл бұрын
To optimize the conversion of a dataset into CSV cells, there are a few approaches you can consider: Use a streaming approach: Instead of loading the entire dataset into memory and then converting it to CSV, you can process the data in a streaming manner. This means reading and converting the data row by row, and writing it directly to the CSV file. This approach can help reduce memory usage and improve overall performance. Utilize parallel processing: If your dataset is large and can be processed in parallel, you can consider dividing the dataset into smaller chunks and processing them concurrently. This can help leverage the power of multiple CPU cores and speed up the conversion process. Optimize your code: Review your code implementation and look for any potential bottlenecks or areas that can be optimized. Consider using efficient data structures and algorithms, minimizing unnecessary operations, and optimizing any loops or iterations. These are just a few general suggestions. The optimal method for converting your specific dataset into CSV cells may depend on the nature of your data and the requirements of your application.
Creating Excel Files in C#
55:42
IAmTimCorey
Рет қаралды 129 М.
ССЫЛКА НА ИГРУ В КОММЕНТАХ #shorts
0:36
Паша Осадчий
Рет қаралды 8 МЛН
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
Who is More Stupid? #tiktok #sigmagirl #funny
0:27
CRAZY GREAPA
Рет қаралды 10 МЛН
I Sent a Subscriber to Disneyland
0:27
MrBeast
Рет қаралды 104 МЛН
C# CSV Files | Read, Write, Append | HD 720
21:01
tips'n tricks (Tips&Tricks)
Рет қаралды 26 М.
The BEST Way to Read a CSV File in C# | CsvHelper Tutorial
9:41
Roberts Dev Talk
Рет қаралды 61 М.
Intro to the CsvHelper Library for C#
27:12
IAmTimCorey
Рет қаралды 29 М.
Hardy's Integral
13:47
Michael Penn
Рет қаралды 15 М.
Coding Gem #1.4: Parsing CSV Data as Objects in C#
14:33
ParametricCamp
Рет қаралды 13 М.
Coding Gem #1.3: Parsing CSV Data as Lists in C#
24:31
ParametricCamp
Рет қаралды 27 М.
Working With The File System in C# - Managing Folders and Files
35:07
How to Import CSV Data to a Database Using C#
16:10
Code Absorb
Рет қаралды 25 М.
Intro to Records in C# 9 - How To Use Records And When To Use Them
1:19:44
ССЫЛКА НА ИГРУ В КОММЕНТАХ #shorts
0:36
Паша Осадчий
Рет қаралды 8 МЛН