Mar-11-2024, 03:54 AM
(This post was last modified: Mar-11-2024, 05:01 AM by deanhystad.)
Hello!
I parse emails with receipts to collect a database using Python.
Idea is to concatenate line starting with "&" or lowercase alphabet letter with previous line.
That part of the code is:
What is my mistake?
I parse emails with receipts to collect a database using Python.
Idea is to concatenate line starting with "&" or lowercase alphabet letter with previous line.
That part of the code is:
# Concatenate lines starting with '&' or starting with lowercase to the end of the previous line combined_lines = [] for line in soup.stripped_strings: if (line.startswith('&') or line[0].islower()) and combined_lines: combined_lines[-1] += ' ' + line.lstrip() else: combined_lines.append(line)The "&" is working but lowercase is not.
What is my mistake?
deanhystad write Mar-11-2024, 05:01 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.