What is the difference between these two file format.
i found this from Here
.txt File: This is a plain text file which can be opened using a notepad present on all desktop PCs running MS Windows any version. You can store any type of text in this file. There is no limitation of what so ever text format. Due to ease of use for end users many daily data summery providers use .txt files. These files contain data which is properly comma seperated.
.csv File: abreviation of "comma seperated values" This is a special file extension commonly used by MS Excel. Basically this is also a plain text file but with a limitation of comma seperated values. Normally when you double click this type of file it will open in MS Excel. If you do not have MS Excel installed on your computer or you find Notepad easy to use then you also can open this file in a notepad by right clicking the file and from the menu select "Open With" and then choose notepad.
My Question :
StreamWriter
and does it need to only change the the extention to .csv?thanx....
Converting text files to CSVFor PC, head to the "File" menu, and choose "Save as". You'll type in the name of your file, and add the extension ". csv". This will automatically change it to CSV format!
In CSV file we can able to store categorical of data because of it formate which is not possible in the text file so in case of categorical data CSV is faster than text.
A text file is used to store standard and structured textual data or information that is human readable. It is defined in several different formats, including the most popular ASCII for cross-platform usage, and ANSI for Windows-based operating platforms.
CSV files are plain-text files, making them easier for the website developer to create. Since they're plain text, they're easier to import into a spreadsheet or another storage database, regardless of the specific software you're using. To better organize large amounts of data.
what does means comma seperated value?
Values separated by Comma, for example.
Name,Id,3,Address
if i'm going to create .csv file using c#, does i need to write file using StreamWriter and does it need to only change the the extention to .csv?
Changing extension of the file will help you in opening it in MS Excel, other than that it can be anything and you can still open it through your code (StreamReader)
if so do i need to change the writing string with commas?
Yes, separate your values with Comma
, or you can use any other delimiter you like. It can be semicolon ;
as well since ,
in some languages/cultures is used for decimal separator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With