Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I am create one windows application.in this application i am given directory.In this directory all csv files is there.How to read all csv file take one by one dynamically.After Complete cycle and wait for another csv file.like this run continuous mode.please tell me solve this problem.
thank you

regards,
raju
Posted
Updated 1-Dec-13 19:57pm
v2
Comments
Rajesh Anuhya 2-Dec-13 2:09am    
Have you tried any thing?

Reading Directory

string[] fileList = Directory.GetFiles( @"Z:\My Documents\", "*.csv");


Reading files

1.
var reader = new StreamReader(File.OpenRead(@"C:\test.csv"));

2.
C#
using (var rd = new StreamReader("filename.csv"))
{
    while (!rd.EndOfStream)
    {

3.
var contents = File.ReadAllText(filename)


Try to explore more on Google/CP

Thanks
--RA
 
Share this answer
 
 
Share this answer
 

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