I ♥ Shortcuts: Ugly data and Shortcuts

I’ve been learning Shortcuts for the first time this month inspired by MacStories.net’s contest. I just want to say how lovely this thing is!

I was able to take 817 days worth of de-identified data that was sent to me as poorly formatted PDF mail attachments, automate the cleaning of that data with a bunch of regex matches and replaces, and automatically add it to a Numbers sheet where I could do some pivots and graphs. I’m not a data-guy. And it wasn’t that hard. Plus I learned some things.

Few stumbling blocks include the fact that Shortcuts doesn’t do much with mail. I’m guessing there’s a privacy reason that Apple didn’t want to even touch. Also, Shortcuts would give up after 300 or so PDFs. Did I fill up the memory? But I broke it up into 100-sized chunks and it worked perfectly.

3 Likes

Now you are!

(20 characters)

4 Likes

Welcome to Shortcuts!

I’ve had Shortcuts stop working on me with long-running loops in the past. If I had to guess, maybe iOS is killing the process in the background? Maybe a developer can correct me.

I’d be interested in knowing how you went about getting the raw data out of the PDF attachments so you could process them as you described.

Thanks!

Then I just reviewed the output to look at the pattern the text took. The PDF has a table, but the text coming out of it was in a much different order. But it seems consistent.

Thanks! I’ll try mine and see if there’s any kind of consist pattern.