I am trying to reproduce the illustration of cleaning up imported data in Mathematica from here.
I had to make a slight change in input 13 to j[x_] := If[StringMatchQ[x, "TOTAL*"], x, DateList[x]];
After running input 14, I get the following output:

There is a "TOTAL" row for every year. The article proposes to delete those rows by running tmp4 = DeleteCases[tmp3, {"TOTAL*", __}];
(the asterisk I my contribution). But it doesn't work! After searching the internet, I found that DeleteCases
is not compatible with string patterns. here.
So how do we delete those rows?
And if DeleteCases
is truly incompatible, how did the Mathematica article succeed?
PS: I did manage to delete those rows by sorting the data and then Dropping them. But I would still like to know how to proceed with DeleteCases
because there might be situations where Sorting doesn't work.