How to remove lists in a list containing a variable string pattern in the Wolfram Language How To: Clean Up Data Imported from a Website ( http://reference.wolfram.com/language/howto/CleanUpDataImportedFromAWebsite.html )
In this example, the HTML page imported contained a summary row for each year that began with the string “TOTAL”. The web page has been updated since the ‘How To’ was written and the summary row for each year now begins with the string “TOTAL YYYY”, where “YYYY” is the year being summarized. See below:
tmp3 = {{"January 2015", "9,552.0", "38,158.4",
"-28,606.4"}, {"February 2015", "8,699.8", "31,240.1",
"-22,540.3"}, {"March 2015", "9,887.2", "41,121.9",
"-31,234.7"}, {"April 2015", "9,316.8", "35,795.1",
"-26,478.3"}, {"May 2015", "8,758.8", "39,211.2",
"-30,452.4"}, {"June 2015", "9,687.8", "41,145.1",
"-31,457.3"}, {"July 2015", "9,500.7", "41,077.2",
"-31,576.6"}, **{"TOTAL 2015", "65,403.1", "267,749.0",
"-202,345.9"}**, {"January 2014", "10,266.1", "38,278.6",
"-28,012.5"}, {"February 2014", "9,766.4", "30,617.1", "-20,850.7"}, ...
The original example used DeleteCases of the form:
tmp4 = DeleteCases[tmp3, {"TOTAL", __}];
to remove the total lists (rows) for each year. This no longer appears to work, as the first element in the list is no longer a static value for each total row, rather it is of the format described above, “TOTAL YYYY”. How would you recommend updating this ‘How To’ example to handle this new data import?
Thx!