I new with C# and in and I have some questions. I'm writing some program that get the following output from remote machine (using SSH):
wwn = 5001248018b6d7af
node_wwn = 5001248018b6d7ae
wwn = 5001248118b6d7af
node_wwn = 5001248118b6d7ae
wwn = 5001248218b6d7af
node_wwn = 5001248218b6d7ae
wwn = 5001248318b6d7af
node_wwn = 5001248318b6d7ae
The output above save into string...
I need to extract from this output List or Array in the following format:
50:01:24:80:18:b6:d7:af:50:01:24:80:18:b6:d7:ae
each two lines are couple (wwn and node_wwn)
I worth the following function
public void OutPutParse (string output)
{
string wwnn = null;
string wwpn = null;
string[] test = output.Split('\n');
test = test.Where(item => !string.IsNullOrEmpty(item)).ToArray();
//run all over the test array and exrract the wwns and wwpn
for (int i = 0; i < test.Length; i++)
{
}
}
this function create an array (test) of wwns and node_wwn
the expected results is an array or list the will include wwn + node_wwn like this 50:01:24:80:18:b6:d7:af:50:01:24:80:18:b6:d7:ae