codeice / linqtoexcel

Automatically exported from code.google.com/p/linqtoexcel
0 stars 0 forks source link

How to Read A CSV File Header Row ? #96

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.General CSV File
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by rameshro...@gmail.com on 31 Oct 2013 at 5:24

GoogleCodeExporter commented 8 years ago
You can use the GetColumnNames method to read the header row: 
https://github.com/paulyoder/LinqToExcel#query-column-names

Original comment by paulyo...@gmail.com on 31 Oct 2013 at 12:10

GoogleCodeExporter commented 8 years ago
Hi ,
I Have tried this it does not work , I am reading a CSV file and want to read 
the first row as a column header.

This does not work for CSV ? please can you let me know what are the other 
methods exists to read CSV headers ?

The GetColumnNames() method can be used to retrieve the list of column names in 
a worksheet.
var excel = new ExcelQueryFactory("excelFileName");
var columnNames = excel.GetColumnNames("worksheetName");

Original comment by rameshro...@gmail.com on 3 Nov 2013 at 10:22

GoogleCodeExporter commented 8 years ago
this does not work since the CSV file does not have sheets because the method 
GetColumnNames  expects the sheet name ? or have a interpreted this wrong .

also can you let me know when I am reading a CSV file and have a data column 
value as 
Col Header 
123R ( THIS DOES NOT READ) any reason for this ... 
45678 

Original comment by rameshro...@gmail.com on 12 Nov 2013 at 5:35

GoogleCodeExporter commented 8 years ago
Hi  Paul ,

I have posted a question regarding reading CSV file from LINQTOEXCELE since I 
have used this lib to a production application and having issue with this now I 
would like your kind knowledge on this area.

first  I am trying to read a simple CSV file that has 

Header1,Header2,Header3

value1,value2,1234

value1,value2,1234TEST

value1,value2,TEST1234

I have noticed that it cant read the column when it have mixed with alpha and 
numeric is this the case if not please can you point me in the correct 
direction.

Thanks ,

Ro 

Original comment by rameshro...@gmail.com on 12 Nov 2013 at 5:45