Click here to Skip to main content
15,902,846 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using streamwriter into xls. file Pin
pmarfleet13-Oct-07 5:19
pmarfleet13-Oct-07 5:19 
GeneralRe: Using streamwriter into xls. file Pin
andredani13-Oct-07 6:16
andredani13-Oct-07 6:16 
GeneralRe: Using streamwriter into xls. file Pin
pmarfleet13-Oct-07 6:36
pmarfleet13-Oct-07 6:36 
GeneralRe: Using streamwriter into xls. file Pin
Giorgi Dalakishvili13-Oct-07 6:47
mentorGiorgi Dalakishvili13-Oct-07 6:47 
GeneralRe: Using streamwriter into xls. file Pin
Dave Kreskowiak13-Oct-07 9:21
mveDave Kreskowiak13-Oct-07 9:21 
GeneralRe: Using streamwriter into xls. file Pin
darkelv14-Oct-07 16:02
darkelv14-Oct-07 16:02 
GeneralRe: Using streamwriter into xls. file Pin
Dave Kreskowiak14-Oct-07 16:16
mveDave Kreskowiak14-Oct-07 16:16 
Questioncreate a .csv file using a variable as the name Pin
mocasu13-Oct-07 3:35
mocasu13-Oct-07 3:35 
Hi,

I would like to know how I can create a .csv file with today's date and a variable name.

I have the following:
int day = date.Day;
int month= date.Month;
int year= date.Year;
string str="hi";
int res="123";


Now I want to create a .csv file with the following name : 13102007_hi_123

I though of putting everything into a single string (lets' say, result) but then, how will the following code replace result with the string!? At present it creates a .csv file with the name of result

if (!File.Exists("c:\\code\\result.txt"))
{
File.Create("c:\\code\\result.txt");
}

Any help will be greatly appreciated...Cheers!

ALSO, can I add a heather that will be ignored by excel?
AnswerRe: create a .csv file using a variable as the name Pin
Guffa13-Oct-07 4:04
Guffa13-Oct-07 4:04 
GeneralRe: create a .csv file using a variable as the name Pin
mocasu13-Oct-07 4:08
mocasu13-Oct-07 4:08 
GeneralRe: create a .csv file using a variable as the name Pin
mocasu13-Oct-07 4:12
mocasu13-Oct-07 4:12 
GeneralRe: create a .csv file using a variable as the name Pin
Colin Angus Mackay13-Oct-07 4:15
Colin Angus Mackay13-Oct-07 4:15 
GeneralRe: create a .csv file using a variable as the name Pin
mocasu13-Oct-07 4:25
mocasu13-Oct-07 4:25 
JokeRe: create a .csv file using a variable as the name Pin
Colin Angus Mackay13-Oct-07 4:30
Colin Angus Mackay13-Oct-07 4:30 
GeneralRe: create a .csv file using a variable as the name Pin
mocasu13-Oct-07 4:34
mocasu13-Oct-07 4:34 
GeneralRe: create a .csv file using a variable as the name Pin
Colin Angus Mackay13-Oct-07 4:41
Colin Angus Mackay13-Oct-07 4:41 
GeneralRe: create a .csv file using a variable as the name Pin
DaveX8613-Oct-07 4:57
DaveX8613-Oct-07 4:57 
GeneralRe: create a .csv file using a variable as the name [modified] Pin
mocasu13-Oct-07 5:05
mocasu13-Oct-07 5:05 
GeneralRe: create a .csv file using a variable as the name Pin
DaveX8613-Oct-07 5:19
DaveX8613-Oct-07 5:19 
GeneralRe: create a .csv file using a variable as the name Pin
Dave Kreskowiak13-Oct-07 5:08
mveDave Kreskowiak13-Oct-07 5:08 
GeneralRe: create a .csv file using a variable as the name Pin
mocasu13-Oct-07 5:25
mocasu13-Oct-07 5:25 
GeneralRe: create a .csv file using a variable as the name Pin
Guffa13-Oct-07 6:27
Guffa13-Oct-07 6:27 
GeneralRe: create a .csv file using a variable as the name Pin
DaveX8613-Oct-07 5:28
DaveX8613-Oct-07 5:28 
GeneralRe: create a .csv file using a variable as the name Pin
PIEBALDconsult13-Oct-07 5:31
mvePIEBALDconsult13-Oct-07 5:31 
GeneralRe: create a .csv file using a variable as the name Pin
Christian Graus13-Oct-07 10:33
protectorChristian Graus13-Oct-07 10:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.