Last active
July 23, 2024 13:32
-
-
Save alexalannunes/701174f855da6ec849846909daec7730 to your computer and use it in GitHub Desktop.
extract bills from nubank
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
` | |
15 MAI Picpay *Enel Distribu - Parcela 4/5 R$ 26,46 | |
21 MAI Brisanet*Internet R$ 94,99 | |
22 MAI Pagamento em 22 MAI -R$ 1.160,77 | |
22 MAI Saldo restante da fatura anterior R$ 0,00 | |
22 MAI Saldo restante da fatura anterior R$ 0,00 | |
24 MAI Mercadinho e Hortifrut R$ 4,50 | |
24 MAI Angela Maria Morais S R$ 14,36 | |
24 MAI Mercantil Mundinho R$ 9,61 | |
24 MAI Google Adobe Inc R$ 7,99 | |
24 MAI Leila Carneiro Matias R$ 5,00 | |
25 MAI Mercantil Mundinho R$ 22,38 | |
25 MAI Mercantil Mundinho R$ 8,47 | |
25 MAI Pag*Mariamarleide R$ 22,00 | |
`.split('\n').filter(s => !!s).map(line => { | |
const regex = /(\d{1,2}\s[A-Z]{3})\s(.+)\sR\$\s?([\d.,]+)/; | |
const [,date, desc, price] = line.match(regex) | |
return `${date}, ${desc}, ${price}`; | |
}).join('\n'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
idea: Made a ui for this
Bonus
=====