Solved

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

Posted on 2009-07-08
3
581 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

635 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