Welcome to the IDM Forum. This forum is meant as a user-to-user support mechanism where users can share knowledge and tips for all IDM software.
Since these forums are user-to-user based, IDM does not regularly read or reply to the posts in this forum. For problem reports, suggestions, or feature requests, you must email us directly. Our trained technical support staff answers most inquiries within 30 minutes.
Search string:
^([\w\s]+?,\w+?)(,.+)(\r?\n\1.*?)+$
Replace string:
\1\2

# -*- coding: iso-8859-1 -*-
import re
result = re.sub(r"(?m)^([\w\s]+?,\w+?)(,.+)(\n\1.*?)+$", r"\1\2", open("input.csv","r").read())
output = open("output.csv","w")
output.write(result)
output.close()
One line
One more line
One line again
Another line
Another line too
Another different lineOne line
Another lineOne line\r
One line again
Another line\r
Another different line

pietzcker wrote:Perl regexes in UE do require \r\n if you want to match a newline in a DOS file. I don't think that that's an error; from what I have gathered, other regex implementations, especially Perl, will handle newlines the same way.

