Solved

how to check number of records in .csv file using asp.net/vb.net

Posted on 2009-07-08
3
577 Views
Last Modified: 2013-11-08

I have .csv file in my http://mywebsite/folder1/test.csv" using asp.net/vb.net.
 i want to check are there any records in it or not how can i check this.

Thanks
0
Comment
Question by:ram27
3 Comments
 
LVL 15

Expert Comment

by:David L. Hansen
ID: 24806034
'Split the file into an array of Records
     Dim chrReturn As Char = Chr(13)
     Dim strRecordsAsWhole As String() = strCsvFile.Split(chrReturn)
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 24822483
In CSV, each record is usually on a separate line so do the following


RecordCount = IO.File.ReadAllLines("path").Length()

Open in new window

0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question