[Solved] How to extract a line from text file that is digits-only? [closed]


You can build a list of lines skipping the digit ones this way :

lines = [line for line in data.splitlines() if not line.strip().isdigit()]

assuming data is your text file content.

1

solved How to extract a line from text file that is digits-only? [closed]