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

[ad_1]

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

[ad_2]

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