Click here to Skip to main content
15,923,142 members
Home / Discussions / C#
   

C#

 
GeneralRe: Ping Leaking Pin
Dave Kreskowiak13-Jul-07 6:30
mveDave Kreskowiak13-Jul-07 6:30 
QuestionJava to C# eBook Pin
Sukhjinder_K13-Jul-07 2:45
Sukhjinder_K13-Jul-07 2:45 
AnswerRe: Java to C# eBook Pin
Christian Graus13-Jul-07 3:24
protectorChristian Graus13-Jul-07 3:24 
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 
Hi frinds,

First of all thanks, I got the code to Convert CSV file to XLS file using Excel Application object.

My code:

using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using Microsoft.Office.Interop.Excel;

namespace File_Conversion
{
class Program
{
static void Main(string[] args)
{
ApplicationClass app = new ApplicationClass();
Workbook doc = app.Workbooks._Open(
@"C:\GCProject\Input Example.csv",
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
false,
Missing.Value,
Missing.Value,
false);
Console.WriteLine("Reading CSV File........");
doc.SaveAs(
@"C:\GCProject\Output.xls",
XlFileFormat.xlWorkbookNormal,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
XlSaveAsAccessMode.xlExclusive,
Missing.Value,
false,
Missing.Value,
Missing.Value,
Missing.Value);
doc.Saved = true;
Console.WriteLine("Converted CSV to XLS file");
app.Quit();
Console.ReadLine();


}
}
}


But Now, I have to get specified format, Like follows.

My CSV file Contains Data like.
-----------------------------------

Ex: DriverID | CustomerID | Ship to ID | Load # | BOL Date/TimeStamp |PrdNam
520 | 2355 - | 1 | 61953 | ############ | 1 Eth 87

My XLS file Contains Data Like.
-----------------------------------------------------------------------------
Ex: Field | Definition | Length | Starting Column | Ending Column |
-----------------------------------------------------------------------------
delimiter"
-----------------------------------------------------------------------------
TransType|Some Definition |1 | 1 | 1
|
-----------------------------------------------------------------------------
delimiter ","
-----------------------------------------------------------------------------
Termin ID | Some Difinition| 3 | 3 | 5
|
-----------------------------------------------------------------------------
delimiter ","
-----------------------------------------------------------------------------
Term SPLC | Some Difi | 7 | 6 | 12
|
-----------------------------------------------------------------------------

I got the code converting CSV file to XLS file. But What I need is Converted
XLS file should look like above format in Converted Excel sheet.

Any body have Idea !!!!


Hope I explained well.!

Thanks in advance.

Regards,
Liyakhat.

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 
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 

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.