saswati_m
asked on
read flat file
I am trying to read a fixed width flat file from C# code, any ideas ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
C#
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- StreamReader sr=new StreamReader(FilePath);
Header=sr.ReadLine();
string Detail=String.Empty;
while(sr.Peek()>=0)
{
Detail=sr.ReadLine();
}
sr.Close();
MessageBox.Show(Detail);
--------------------------
Header=sr.ReadLine();
string Detail=String.Empty;
while(sr.Peek()>=0)
{
Detail=sr.ReadLine();
}
sr.Close();
MessageBox.Show(Detail);
Dog pile!!!
string[] lines = File.ReadAllLines("File_Pa th");
Bob
string[] lines = File.ReadAllLines("File_Pa
Bob
string str = File.ReadAllText("File_Pat
Messagebox.Show(str);