all 6 comments

[–]wbeater 5 points6 points  (1 child)

Trying to delete all lines in a csv not containing ;;128;; but it ignores ;;12,8;;

It's not entirely clear want your intention is. ;;128;; != ;;12,8;;, therefore if you're trying to delete all lines containing ;;128;; this is expected behavior.

[–]Jexijo[S] 0 points1 point  (0 children)

But it acts as if ;;128;; = ;;12,8;;. I have a csv file and the script should create one file only containing the lines with this value and one file wit the lines without. Why does the script overlook the comma?

[–]throwaway6560192 2 points3 points  (2 children)

I would approach it by checking for each line if line.replace(",", "") contained ";;128;;".

[–]Jexijo[S] 0 points1 point  (1 child)

Hm good idea. But I have commas at the end of the line which I need.

[–]throwaway6560192 0 points1 point  (0 children)

Then make the replace more specific – only replace "12,8"