Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have got txt file which contain data of 224 columns and 'n' no. of records

what I want is to count for each column(BLANK AND NON-BLANK)

for eg. if there are 10 records than for
column 1(BLANK=3, NON-BLANK=7)
column 2(BLANK=0, NON-BLANK=10)
column 3(BLANK=1, NON-BLANK=9)
.
.
.


and so on
this I want to do from asp.net (C#)

HELP!!!!!!!!
Posted

1 solution

if the text file contains records in correct format, then better import the data from text into SQL-Server or use MS-Excel to import the data from text. After that use that data from table in Asp.net.

Importing text file data in SQL-ServerLink[^]

Importing text file data in MSExcel is much more easier. Click Open-> browse to your file(i.e text file) and then use its text import wizard to show data in Excel.
 
Share this answer
 
Comments
sachees123 20-Aug-11 8:41am    
This is the way to import/export data, but what to do for the count???
Praveen Kullu 20-Aug-11 8:59am    
Once you import data in SQL Server, then just use the count method.
Example:
For empty columns:
select count(columnname) from <tablename> where columnname=''
for non empty columns:
select count(columnname) from <tablename> where columnname!=''

There are other ways too..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900