in reply to Find & Replace

So for each line in your file, you want to replace one or more commas at the end of the line, with a single comma - yes?

If that's the case, it's as simple as:

while (<LINES>) { $_ =~ s/,+$/,/; }

(You could actually do this from the command line with something like: perl -pi -e 's/,+$/,/' file.txt)

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.