Is it not dangerous to ignore text based on its color? For this particular case it might work but looks like you have a generic service that is supposed to work with any bank statement.

Yes it’s not a safe general rule. I can do it because I first classify the statement into a document_type and then run special code for specific document_types.