i have a list named simple and all its objects are in the form below:
Tag: textbook - sacred texts Rec Id: 10011095
Tag: advocacy Rec Id: 10037815
Tag: advocacy Rec Id: 10043396
Tag: advocacy Rec Id: 10037795
Tag: advocacy Rec Id: 10031437
Tag: advocacy Rec Id: 10035721
Tag: advocacy Rec Id: 10024853
and i have a second list called fullList with objects like:
10055853 What's the Matter with the Internet? by Mark Poster academic 1 0,083
10055853 What's the Matter with the Internet? by Mark Poster computers 1 0,083
10055853 What's the Matter with the Internet? by Mark Poster internet 2 0,167
i split every line of the simpe list in order to get two strings.
The first one has the word(s) after “Tag:” and before “Rec Id:” and the second the numbers after Rec id.
Example: tagGB = textbook - sacred texts
rec_idGB = 10011095
And then i want to search if there IS’NT any line(object) from list fullList that contains BOTH (in the same line) that two strings.
I tried that:
foreach (String line in nonZeroList)
{
foreach (String line2 in Gblist)
{
rec_idGB = line.Split('\t')[0].Substring(4).Trim();
tagGB = line.Split('\t')[2].Substring(7).Trim();
if (line.Contains(rec_idGB) == false && line.Contains(tagGB) == false)
{
}
}
}
but i get a lot of lines that doesnt contain that strings.
I want to get as a resutl only the rec_idGB and tagGB that are not BOTH in the same line of the fullList. Any suggestions?
So you want all lines in simpleList that can’t be matched with any line in fullList? (Or do you want for each line in fullList get all lines in simpleList that doesn’t match? I guess not.)