Is it possible to create a CSV file with C#, open the file but not saving it?
Asked
Active
Viewed 1,083 times
-1
-
Did you tried it first? – Soner Gönül Feb 13 '14 at 12:22
-
1What do you mean by *not saving it*? – Lloyd Feb 13 '14 at 12:22
-
check this out: http://stackoverflow.com/questions/5282999/c-net-reading-csv-file?rq=1 – Fabian Bigler Feb 13 '14 at 12:23
-
Your question is not precise enough. What do you want ? A CSV stream writer which does not write to disk ? use MemoryStream, and then copy the stream to disk when you want to "save". – Olivier Feb 13 '14 at 12:23
-
1I just want to open the CSV format in a Excel file, but the file should not be saved somwhere. – Venyla Feb 13 '14 at 12:26
1 Answers
1
CSV is a format. You can build this format in memory without persisting it to disk. Is that what you mean? How do you want to "open" the file? For example Excel only works with existing files, or you can use interop to fill the data in a new document.

CodeCaster
- 147,647
- 23
- 218
- 272
-
1I wanted to open it with Excel, but I just want to write the data in it so the user can look at it and if he want to save it he can save where ever he want to. – Venyla Feb 13 '14 at 12:25
-
Then take a look at [How to: Use COM Interop to Create an Excel Spreadsheet (C# Programming Guide)](http://msdn.microsoft.com/en-us/library/ms173186(v=vs.80).aspx). – CodeCaster Feb 13 '14 at 12:25