#!/usr/bin/perl -w use strict; my @row; my $separator=','; open(INPUT,"< temp.txt") or die "could not open"; while(){ chomp; push @row,$_;}; foreach (@row) { s/(\\+)/$1$1/g; } print join($separator, @row); print "\n"; #### aa bb \\c\c\ d\d
## aa bb \\c\c\ d\d