Quantcast
Channel: Active questions tagged string-manipulation - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 186

Cleaning up a string list

$
0
0

I have a very poorly-formed list of football scores:

{{"Glenville State", "GLN 44", "9", " Northwood (MI)"} {" Missouri Southern State", "24", "Northwest Missouri State", "NOR 31"},  {"SDST 45", " South Dakota State", "Western Oregon", "7"},  {" Central Oklahoma", "CEN 24", "Nebraska-Kearney", "21"}, {"17", " University of Rochester (NY)", "Utica", "UTI 20"}}

I'd like to clean up this list so that each game has the same format {team1,score1,team 2,score2} which would give:

{{"Glenville State", "44", " Northwood (MI)", "9"} {"Missouri Southern State", "24", "Northwest Missouri State", "31"} {"South Dakota State", "45", "Western Oregon", "7"} {"Central Oklahoma", "24", "Nebraska-Kearney", "21"} {"University of Rochester (NY)", "17", "Utica", "20"}}

As can be seen, the all-caps abbreviations get deleted. Is there a way to do this without writing rules for each variant?


Viewing all articles
Browse latest Browse all 186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>