Hi Everyone,
I have the following code -
- static void Main(string[] args)
- {
- Console.Clear();
- string fileName = "\\file1.csv";
- fileName = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + fileName;
- var fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
- using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
- {
- string line,ID, UniqNumber;
- while ((line = streamReader.ReadLine()) != null)
- {
- ID = line.Length >= 1 ? line.Substring(1,7) : string.Empty; UniqNumber = line.Length >= 1 ? line.Substring(8, 12) : string.Empty;
- Console.WriteLine("ID={0},UniqNumber={1}", ID, UniqNumber);
- }
- }
- Console.ReadKey();
- }
Thanks,

Midhun TpPosted Oct 18, 2016, 5:07 AM
Midhun TpPosted Oct 19, 2016, 4:26 AM
Ms_ DevPosted Oct 19, 2016, 4:12 AM
Salman BegPosted Oct 18, 2016, 4:49 AM