Skip to content

Instantly share code, notes, and snippets.

@commuterjoy
Created November 25, 2013 13:17
Show Gist options
  • Save commuterjoy/7641048 to your computer and use it in GitHub Desktop.
Save commuterjoy/7641048 to your computer and use it in GitHub Desktop.
# grep -Ri 'm.d.viewability.Viewability' * | cut -d ':' -f 2- | cut -d ' ' -f 1,2,8- > raw
# ruby formatter < raw > advert-data-raw
# sort advert-data-raw > advert-data-raw.sorted
STDIN.read.split("\n").each { |a|
b = a.split(",")
date = b.shift
data = b.slice(0,b.length).map { |f|
c = f.split("->")[1]
c.gsub!(/Some\(([\d+])\)/, '\1')
c.gsub!("None", "-")
c
}
puts data.unshift(date).join(",")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment