Although its easy in python but i am new to C# and i am having trouble extracting a particular word from a string . i have two txt file .
abc.txt
select * from schema1.table1
xyz.txt
select * from schema2.table2 where a=5
i need to extract "schema1" and "schema2" words only but i tried but i am having trouble with it as it is C#.
MY code
{
StreamReader sr = new StreamReader(file);
string data = sr.ReadLine();
while (data != null)
{
string[] values = data.Split('.');
foreach (string value in values)
{
Console.WriteLine(value.Split(' ').Last());
data = sr.ReadLine();
}
}
}
but the output gives whole lot of other words too . any kind of lead is appreciated .