Regular Expressions to automate metrics is an investment everyone should do!

regular expressions to automate metrics

Regular Expressions

Regular Expressions to automate metrics

I’ve written a script that logs into our vendor website and exports the recent email campaigns then breaks them out by region, campaign type, Business Unit, etc. and links them back to our SharePoint site for more information.  The script relies on a regular expression to automate metrics on our long string name and parse-out sections by examining patterns in the Naming convention.

My script first logs into our tool (SilverPop) and performs web scraping to capture the data and dumps it to a local HTML file.  I then use Excel to import the HTML file and start parsing the naming convention with the regular expression.   After all the columns are created I replace some of the short abbreviations with longer, easier to understand, words.   Then I insert functions aggregating the metrics by Type of campaign, Region, Language etc.   After that I break out four regions.  All in all it takes about 10 minutes to run but saves me about 40 hours worth of work.  The below video demonstrates the regular expressions to automate metrics in action

Automating email metrics

Debugging Python- Have your best debug code at the tip of your fingers

debugging pythonDebugging Python

I’m learning how to program in Python and have put together some decent gui code which can be very helpful when trouble-shooting your code.

Trying to solve issues by just looking at your code can be done but it isn’t nearly as fast as using some real debugging python code.


Helpful Python Debugging Code

AutoHotKey Debugging Python code

There are other tools for debugging Python but this is a good starting place.

When your IT department fails you Web Scraping with AutoHotkey can save the day!

web scraping with AutoHotkey

One of my clients has over 3,000 videos on their website.  Amazingly nobody in their IT department can provide a holistic file with metadata like: Title, # of views, Length, Format, Tags, etc.  How crazy is that?   After contacting their video hosting company, nobody could (would) share this information!

Web Scraping with AutoHotkey to the rescue!

I wrote web scraping with AutoHotKey script that first got a list of all the videos, then looped over them and extracted various attributes about each video.  Not an ideal way to get this, but the client was manually going to go through this by cutting & pasting from their browse.

Extracting Information about Videos

Save a ton of time by creating a syntax writer that writes your code for you!

AutoHotKey syntax writer

Syntax Writer

While fun, writing code can be very tedious in that it needs to be in a specific format. I use hotstrings to replace words I frequently use but what I also realized is I often have to put parameters into specific format like a quote encapsulated/comma delimited list.

This video shows how I wrote some very simple code that makes it much easier for me to be more productive in my SQL code writing.  I have other syntax writers for other languages but the concept stays the same.


Programs that help you write programs