Solved

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

Posted on 2009-07-08
3
573 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now