I have one A File and many input files ,All files have CSV format . I want to match text of one column of all input files with one of the column of A file .
I have stored all column value of File A in HashSet for fast search.
1- Now iterate All input files uses First loop
2- {iterate all elements in each file uses second loop
3- {
and iterate all lines in hashset uses Third loop .
{
Store All lines in List and append true in the end at the end of line if Match found
}
Delete The input File
//Removed Lines
4- // iterate through all stored lines
// {
// Write in same file
// }
//Added Lined
File.WriteAllLine(...)
}
}
1-When i find the match ,i have to make change input File , For this purpose i have to use FileWriteStream, a Collection to store lines and another loop. Delete the File and write again. Is there any optimal solution to achieve this
2- I have used linear Search in order to Search the text in A file .Is it ‘okay’ to use Dictionary so that i takes O(1) to get the element.
3- Is there any good optimal way to read all this .using Oledb ‘can i use the query’?
3