Create CSV file in C# the EASY way | CsvHelper Tutorial

preview_player
Показать описание
This is a tutorial for how to create a CSV file in C# from a list or collection using the excellent open source CsvHelper .NET Standard library. This tutorial will also show you how to format header names and column values with Convert and TypeConverterOption using the fluent API.

Don’t forget, developers run on coffee! 😀

📬 Stay in touch! Join our mailing list

🐦 Follow us on Twitter:

If you're looking for how to read a CSV file (importing), we have a video here for you:

Example code on Github here:

CsvHelper homepage:

I'm Chris Roberts, a freelance software engineer based in the UK:

Our gear - click through to support our channel! :)

Camera (Canon M50)

Camera mic (RODE VideoMic Pro)

Camera tripod (Manfrotto Compact tripod):

Voiceover Mic (Blue Yeti)

Chris's dev mouse for PC (Logitech MX Master 3)

Chris's dev keyboard for PC (Logitech MX Keys)

Rob's dev keyboard for Mac (Apple Magic Keyboard)

Rob's dev mouse for Mac (Apple Magic Mouse)
Рекомендации по теме
Комментарии
Автор

I am really liking this channel thank you Robert

husseinadam
Автор

Your example is awesome. Thanks for the CsvHelper series.

AlbrechtJ
Автор

Thanks for the video. I really pretty much understood everything you had shown and demonstrated.

kopilkaiser
Автор

Hello, please where does the newly created file goes ? Evrything compile OK, but i cannot find the file
Thx

sofianell
Автор

Nice! An idea for some other video, is showing how to work with both mapped and dynamic columns.

joffrelustosadoamaralmota
Автор

Is there a way to target specific cells, i am creating a little finance program and i need to change the users balance that is stored within the CSV file, is there a way i can target just that specific cells when writing records?

harveyemmerson
Автор

Hi you can help me! i'm trying save .csv but first i Open .DAT File -> .csv save format! can you help?

AeroTesting
Автор

hi, can u please make a video on state pattern ex like stopwatch

indreeshpandey
Автор

nice video. is there any way to sort the column heads vertically instead of the default horizontal line? I cant seem to figure it out

jamesallgood
Автор

Hi is there a way to update the Environment.CurrentDirectory path. For example, if you have 3 projects in one solution and the 3rd project is a repository and you want the file to be saved in that 3rd project folder then the main project 1 that has the Controller?

badrulhussain
Автор

Hi, please tell me how to change the delimiter?

egorzh
Автор

hi,
can u please tell how to find the average of the payload capacity?

indreeshpandey
Автор

Hi, I don't know why but even following all the steps you have made my data are all inside the first element of the row in the .csv file, and not one for each column as in your example. Could you please help me?

PaoloBoffi
Автор

Hello, Thanks for the video, I have a problem with this line " return ? $"{rocket.PayloadCapacity} kg" : String.Empty; " I don't know why I have this error : CS1061 'ConvertToStringArgs <RocketInfo>' does not contain a definition for 'PayloadCapacity' and no accessible extension method 'PayloadCapacity' accepting a first argument of type 'ConvertToStringArgs <RocketInfo>' was not found (a using directive or a reference assembly missing?) Can you help me :)

Thanks

favela
welcome to shbcf.ru