I am trying to reproduce the example of Data Cleaning 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 data:
There is a TOTAL row for every year. The article proposes to delete those rows by running (asterisk is my contribution)
tmp4 = DeleteCases[tmp3, {"TOTAL*", __}];
but it doesn't work! After searching StackExchange, I found that DeleteCases is not compatible with string patterns.
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 dropping them, but I'd still like to know how to do it with DeleteCases.
Thanks,
Thad
