Click here to Skip to main content
15,915,086 members
Home / Discussions / C#
   

C#

 
AnswerRe: Java to C# eBook Pin
Paul Conrad13-Jul-07 4:03
professionalPaul Conrad13-Jul-07 4:03 
AnswerRe: Java to C# eBook Pin
PhilDanger13-Jul-07 4:23
PhilDanger13-Jul-07 4:23 
GeneralRe: Java to C# eBook Pin
Sukhjinder_K13-Jul-07 4:28
Sukhjinder_K13-Jul-07 4:28 
GeneralRe: Java to C# eBook Pin
leppie13-Jul-07 4:37
leppie13-Jul-07 4:37 
QuestionCSV format to XSL format in C# Programming Pin
liyakhat_shahid13-Jul-07 2:43
liyakhat_shahid13-Jul-07 2:43 
AnswerRe: CSV format to XSL format in C# Programming Pin
Jimmanuel13-Jul-07 7:03
Jimmanuel13-Jul-07 7:03 
GeneralRe: CSV format to XSL format in C# Programming Pin
liyakhat_shahid16-Jul-07 0:02
liyakhat_shahid16-Jul-07 0:02 
GeneralRe: CSV format to XSL format in C# Programming Pin
Jimmanuel16-Jul-07 2:48
Jimmanuel16-Jul-07 2:48 
The most versatile method is going to be to parse the .csv file and create a .xls file manually.

A .csv file is just a text file, so one method of parsing it is to open and read it with a StreamReader[^] and read it line by line. For each line that you read use the split[^] method to separate the values by comma.

Then to create your own .xls file just follow the example in the link that I gave here[^]. All you need to do is get a workbook like they do with this code:
oXL = new Excel.Application();
oXL.Visible = true;

//Get a new workbook.
oWB = (Excel._Workbook)(oXL.Workbooks.Add( Missing.Value ));
oSheet = (Excel._Worksheet)oWB.ActiveSheet;

and then write the data into the worksheet however you want. The cells in the .xls file can be accessed just like a two dimensional array, so you can arrange the data however you want. Then save the workbook and you're done!

Oh, and it's Jim, not Jammie Smile | :)



GeneralRe: CSV format to XSL format in C# Programming Pin
liyakhat_shahid19-Jul-07 2:43
liyakhat_shahid19-Jul-07 2:43 
Questionsqlceme.dll missing Pin
pmartike13-Jul-07 2:13
pmartike13-Jul-07 2:13 
AnswerRe: sqlceme.dll missing Pin
pmartike13-Jul-07 3:20
pmartike13-Jul-07 3:20 
Questionhow to access file at server side and print Pin
absprogrammer13-Jul-07 1:56
absprogrammer13-Jul-07 1:56 
AnswerRe: how to access file at server side and print Pin
Christian Graus13-Jul-07 3:25
protectorChristian Graus13-Jul-07 3:25 
QuestionC# OLE DB sample? Pin
George_George13-Jul-07 1:51
George_George13-Jul-07 1:51 
AnswerRe: C# OLE DB sample? Pin
Paul Conrad13-Jul-07 12:03
professionalPaul Conrad13-Jul-07 12:03 
GeneralRe: C# OLE DB sample? Pin
George_George13-Jul-07 18:21
George_George13-Jul-07 18:21 
GeneralRe: C# OLE DB sample? Pin
Paul Conrad13-Jul-07 19:06
professionalPaul Conrad13-Jul-07 19:06 
GeneralRe: C# OLE DB sample? Pin
George_George13-Jul-07 19:23
George_George13-Jul-07 19:23 
GeneralRe: C# OLE DB sample? Pin
Paul Conrad13-Jul-07 19:35
professionalPaul Conrad13-Jul-07 19:35 
GeneralRe: C# OLE DB sample? Pin
George_George13-Jul-07 19:56
George_George13-Jul-07 19:56 
Questionlogical drives Pin
md_refay13-Jul-07 1:33
md_refay13-Jul-07 1:33 
AnswerRe: logical drives Pin
Christian Graus13-Jul-07 3:28
protectorChristian Graus13-Jul-07 3:28 
QuestionCreateProcessWithTokenW Pin
Harkamal Singh13-Jul-07 0:22
Harkamal Singh13-Jul-07 0:22 
AnswerRe: CreateProcessWithTokenW Pin
Pete O'Hanlon13-Jul-07 1:50
mvePete O'Hanlon13-Jul-07 1:50 
NewsRe: CreateProcessWithTokenW Pin
Harkamal Singh13-Jul-07 21:12
Harkamal Singh13-Jul-07 21:12 

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.