i've been given a data from txt file for example
Trans ID;Transaction Date;Cashier Name
00001;1 January;Ricky
00001;1 January;Ricky
00002;2 January;Rico
the problem is im new to this kind of file and dont know how to read and export it to a new txt file with separated Trans ID
So in this data, there will be 2 file , the first file is for the list of 00001 Trans ID , and the second file is for the list of 00002 file (or more trans ID to come)
I've tried to read the file
string filename = ("C:\\Users\\Documents\\My Received Files\\txn_success_daily.txt");
string[] lines = File.ReadAllLines(filename);
foreach (string line in lines)
{
string[] col = line.Split(new char[] { ';' });
}
But i dont know how it works, because it different from excel(which basically i create apps to generate excel file)
I need to separate this data, into 2 txt file because it contains different transaction ID. Every different transaction ID, will create a new txt file and put the transaction in it (including the header) .
Thankyou