Skip to content

Instantly share code, notes, and snippets.

@blbradley
Last active November 18, 2016 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blbradley/5337653 to your computer and use it in GitHub Desktop.
Save blbradley/5337653 to your computer and use it in GitHub Desktop.
Using sed to clean my credit card data from Citibank PDFs
# Example data line:
# 06/01 06/01 Bestbuy.com 00009944 888-237-8289 MN -$49.26
echo '06/01 06/01 Bestbuy.com 00009944 888-237-8289 MN -$49.26' \
| sed 's:[0-9]\+/[0-9]\+:&,:g' \
| sed 's: -\?\$[0-9]\+:,&:'
@blbradley
Copy link
Author

Output looks like this:

06/01, 06/01, Bestbuy.com 00009944 888-237-8289 MN, 49.26

@blbradley
Copy link
Author

Output was changed sometime in 2013 to give currency format like '-$49.26'.

@blbradley
Copy link
Author

Citibank changes their download interface. So, I don't think I'll be updating this anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment