I've written this small script which reads the lines of a file (in this case it's just for links). It stores a count of all the clicks in the file so on clicking the link it opens the file, finds the number for the right link and sets it up 1, but when it's doing that and rewriting the file each time a line is placed between each original line so you end up with:
Link Title
Link URL
Link Description
Link Clicks
instead of just
Link Title
Link URL
Link Description
Link Clicks
and each time it's clicked another new line is added so the file gets bigger and bigger with each click. Now this doesn't seem to affect the execution of the script, the lines seem to be ignored, but those lines are costing space. Is there any way I can get rid of the lines other than manually removing them?
Thanks 🙂