During breaks, I find myself playing Emerald version a lot and was tired of having to use the school's slow wifi to access the internet. I wrote a scraper to obtain cheat codes and send them to my psp device. I couldn't come up with a better way of removing the extra whitespace. Any areas I could improve on?


wget -q -O - 'goo.gl/vfYA94' | \
  sed -En '/<strong>([1-9]|[12][0-9]|3[01])/,/<\/blockquote>/p' | \
  sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | \
  egrep -v '^[[:space:]]*$|^#'

1 Answer 1


I presume you are mostly after getting rid of egrep, so sed command to remove empty lines:

  • \$\begingroup\$ For whatever reason that was the only pattern that removed the empty space gap between the 24th cheat. My first approach was sed 's/ //g' but I just brute forced with egrep. Thanks for the tip, man! \$\endgroup\$
    – user27606
    Jul 2, 2014 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.