Try this, it's developed using CSOM, u can change it as per your script. filteritems variable stores the filtered result.
IEnumerable<Microsoft.SharePoint.Client.ListItem> filteritems = null;
ListItemCollectionPosition position = null;
var page = 1;
List<Microsoft.SharePoint.Client.ListItem> items = new List<Microsoft.SharePoint.Client.ListItem>();
try
{
do
{
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = @"<View Scope='RecursiveAll'><Query></Query> <RowLimit>5000</RowLimit></View>";
camlQuery.ListItemCollectionPosition = position;
Microsoft.SharePoint.Client.ListItemCollection listItems = oList.GetItems(camlQuery);
clientContextobj.Load(listItems);
clientContextobj.ExecuteQuery();
items.AddRange(listItems);
position = listItems.ListItemCollectionPosition;
page++;
}
while (position != null);
//throw new Exception("My Exception!");
}
catch (Exception ex)
{
//WSSLogger.Log("Loop Count:" + items.Count.ToString(), ex, RequestUrlAuthority);
}
try
{
filteritems = items.Where(item => (item.FieldValues["Cust_Name"] == null ? string.Empty : item.FieldValues["Cust_Name"].ToString()) == strCustName
&& (item.FieldValues["Cust_Country"] == null ? string.Empty : item.FieldValues["Cust_Country"].ToString()) == strCountry &&
(item.FieldValues["Status"] == null ? string.Empty : item.FieldValues["Status"].ToString()) == "Pending");
//Pending,Active
}
catch (Exception ex)
{
//WSSLogger.Log("-Custinfo-", ex, RequestUrlAuthority);
}