Here is the problem that, I can delete the lines from my folder but I cannot choose them as their simillar way.
For example I had a .json file with 3000 lines or etc and I need to delete the lines that are starting with for example "navig". How can we modificate the Python code?
with open("yourfile.txt", "r") as f:
lines = f.readlines()
with open("yourfile.txt", "w") as f:
for line in lines:
if line.strip("\n") != "nickname_to_delete":
f.write(line)
(The code is taken from another answer.)