• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 594
  • Last Modified:

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


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
ram27
Asked:
ram27
1 Solution
 
David L. HansenProgrammer AnalystCommented:
'Split the file into an array of Records
     Dim chrReturn As Char = Chr(13)
     Dim strRecordsAsWhole As String() = strCsvFile.Split(chrReturn)
0
 
CodeCruiserCommented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now