Writing to a CSV File in C# (Simple)

  Рет қаралды 73,201

Max O'Didily

Max O'Didily

Күн бұрын

Пікірлер: 57
@adityasher
@adityasher 5 жыл бұрын
man o man love the short way of explaining it, other weblinks were very tough to Understand
@vincentvalentine9417
@vincentvalentine9417 4 жыл бұрын
thanks, m8 a lot of times I just need a quick and dirty answer to get me going, then I hash out all the BS later. I really appreciate the not so long-winded response.
@lovegruvberg4631
@lovegruvberg4631 4 жыл бұрын
This tutorial is great! Plain simple and not hard to follow at all, thanks a lot
@paragonpartners2058
@paragonpartners2058 Жыл бұрын
Thanks, you made it easy for me
@mr-spoon
@mr-spoon 6 күн бұрын
5:43 probably some setting in vs
@danh9676
@danh9676 5 жыл бұрын
That was quick, easy, and understandable.
@twistentiger5610
@twistentiger5610 4 жыл бұрын
Thanks for this mate, you have made my life easier
@ShareKnowledge76
@ShareKnowledge76 Жыл бұрын
GREAT article 👍
@Khud0
@Khud0 3 жыл бұрын
Awesome, thanks for a very clear and understandable tutorial!
@faketetrisbeatboxguy4241
@faketetrisbeatboxguy4241 4 жыл бұрын
can you do a video on reading the CSV file?
@maxodidily
@maxodidily 4 жыл бұрын
I have a tutorial on that: kzbin.info/www/bejne/n6jZe2Vsebl-adk
@Paul-ug6rs
@Paul-ug6rs 3 жыл бұрын
Thx Max, do you know how to delete specific data from csv file?
@shreyshah8596
@shreyshah8596 4 жыл бұрын
Thank you for the wonderful explanation!! but have doubt, where to find the txt file when the app is running on android phone??
@youngsolomon9768
@youngsolomon9768 3 жыл бұрын
how do I add a specific file path
@eastern815
@eastern815 Жыл бұрын
You are awesome👍
@coryhobgood
@coryhobgood 5 жыл бұрын
This helped me to create a .txt. But it's not quite a CSV file. Was looking to create a datatable and output that into a .csv file.
@maxodidily
@maxodidily 5 жыл бұрын
Just change the file name to have .csv at the end.
@billpapa4966
@billpapa4966 4 жыл бұрын
@@maxodidily Hey dude, thank you for the tip. I am doing almost the same thing but I am using the user input from a WPF application I made. I store the user input in variables ( userID and telephone) and then insert those to the. CSV file. I don't how to explain it well but apart from only listing the input from the user, it takes "System.Windows.Controls.TextBox: 542384213894 " all of that. The input is the number and the previous thing is probably the textbox. Evidently, I want it to list only the user input. Do you have any idea what might be the cause of this? I implemented my own method but mostly followed your instructions.
@wearytrader535
@wearytrader535 Жыл бұрын
@@maxodidily Insane how simple this solution is lmao. I was going to complain about the same thing, thanks for the tip!
@kuldeeptyagi2339
@kuldeeptyagi2339 2 жыл бұрын
Nice
@lukemyles1367
@lukemyles1367 4 жыл бұрын
Noice wann ..thanks for being a great audience
@shreyanshparashar1152
@shreyanshparashar1152 4 жыл бұрын
sir can you tell me how i can prevent special character in csv or how can i prevent csv injection
@sjuesju
@sjuesju 3 жыл бұрын
What would happen if in any of the string you have a coma? For example "Mercy" is "Mer,cy"
@maxodidily
@maxodidily 3 жыл бұрын
That would result in unwanted behaviour. If you think your data will need commas, you should use a different character or sequence of characters for your delimiter.
@simonsah2619
@simonsah2619 7 ай бұрын
super ty :)
@alexvl4903
@alexvl4903 3 жыл бұрын
Hi! I write Cyrillic lines to the file. When I open it, I see the hieroglyphs. How can I change the encoding when saving?
@Sajibkumarjoarder
@Sajibkumarjoarder 2 жыл бұрын
thank you
@charysafflickstraker1278
@charysafflickstraker1278 4 жыл бұрын
so are we using a console appplication or WFA ?
@maxodidily
@maxodidily 4 жыл бұрын
This code can be used with either but in this tutorial we use a console application as it is quicker.
@kishorkumar.s34
@kishorkumar.s34 4 жыл бұрын
This video was really helpful, but what if we need to add header to these values , how to achieve this.
@maxodidily
@maxodidily 4 жыл бұрын
You could just use the first line of the file as header values and when you read from the file, just ignore the first line.
@cyberlacs
@cyberlacs 5 жыл бұрын
Congratulations on the great video lesson. Simple, objective and straightforward. Live to Visual Studio and C # God is Faithful. And the earth remains flat until further notice. Thank you very much.
@mt03adventures
@mt03adventures 4 жыл бұрын
if you don't close your stream writer it does not work for a .csv file. I mean for me it did not work just after i closed the file. Anyway ty for the video
@maxodidily
@maxodidily 4 жыл бұрын
You should close the stream writer, I forgot to mention that.
@ecerejo
@ecerejo 4 жыл бұрын
From what I understand you don't have to close when you use the keyword "using" like you did. When you use the keyword using it automatically calls Dispose and Dispose will automatically close the writer also. bit.ly/3bGe1M2
@charlesamador3440
@charlesamador3440 4 жыл бұрын
What ecerejo said!! I added the "using" part, and the .csv file worked!!
@hansshadow360
@hansshadow360 4 жыл бұрын
How to add style to cell when export the file?
@maxodidily
@maxodidily 4 жыл бұрын
@@hansshadow360 Indeed you can, here is a link to a stack overflow page: stackoverflow.com/questions/42500606/formatting-excel-sheet-using-c-the-style-apply-to-all-cells-not-to-one-cell
@bikrampoudel4848
@bikrampoudel4848 4 жыл бұрын
what about csv?
@DaveLight395
@DaveLight395 3 жыл бұрын
What do you mean by that ?
@bikrampoudel4848
@bikrampoudel4848 3 жыл бұрын
@@DaveLight395 oh i don't know what did i wanna say at that time 😂 i think i was not quite familiar with CSV at that time 😂
@DaveLight395
@DaveLight395 3 жыл бұрын
@@bikrampoudel4848 oh ok :D
@codymckinney4934
@codymckinney4934 4 жыл бұрын
can we just get the code to copy and paste :)
@malikjavadov366
@malikjavadov366 2 жыл бұрын
danke!
@omgitispewdiepie4072
@omgitispewdiepie4072 6 жыл бұрын
where is your Twitter bot
@16Flavius
@16Flavius 4 жыл бұрын
You are writting in a txt file, not a CSV file.....
@maxodidily
@maxodidily 4 жыл бұрын
It does works if you change .txt to .csv
@MrGeorgemoreno
@MrGeorgemoreno 5 жыл бұрын
Are those blurred directories porn? Just kidding, thanks for the tutorial (y)
@maxodidily
@maxodidily 5 жыл бұрын
They are directories are called "homework".
@0x19
@0x19 4 жыл бұрын
@@maxodidily and those folders have actual homework inside???? xD jk great vid
@andrewmcallister3529
@andrewmcallister3529 Жыл бұрын
Think I'll find a different video, you don't even have file types turned on.
@gregplayz1675
@gregplayz1675 2 жыл бұрын
how do i write into existing rows
@maxodidily
@maxodidily 2 жыл бұрын
kzbin.info/www/bejne/i3eWqaqNqJmNrLs This tutorial should be what you are looking for.
@gregplayz1675
@gregplayz1675 2 жыл бұрын
@@maxodidily thanks so much
Reading from a CSV File and Searching for a Record in C# (Simple)
8:13
The BEST Way to Read a CSV File in C# | CsvHelper Tutorial
9:41
Roberts Dev Talk
Рет қаралды 61 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
How telecom industry works / How many services telecom provide
5:55
Right Way Of Knowledge
Рет қаралды 1
File, FileStream, StreamWriter, and StreamReader | Coding in C#
28:02
The Cynical Philosopher
Рет қаралды 5 М.
Intro to the CsvHelper Library for C#
27:12
IAmTimCorey
Рет қаралды 29 М.
Read and Write files in 10 minutes | C#
9:26
tutorialsEU
Рет қаралды 43 М.
how Google writes gorgeous C++
7:40
Low Level
Рет қаралды 987 М.
C# CSV Files | Read, Write, Append | HD 720
21:01
tips'n tricks (Tips&Tricks)
Рет қаралды 26 М.
C# Read and Write to a Text File
7:09
Programming w/ Professor Sluiter
Рет қаралды 122 М.
C# Read CSV - Tutorial
12:21
Nick Proud
Рет қаралды 8 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН