in reply to Replace only selected characters
Another, possibly simpler, way might be to split the line on commas then glue it all together again, joining using a comma the first element to the remaining elements that have been joined using an empty string.
knoppix@Microknoppix:~$ perl -E ' > $l = q{abc,def,ghi,jkl,mno}; > say $l; > @e = split m{,}, $l; > $l = join q{,}, $e[ 0 ], join q{}, @e[ 1 .. $#e ]; > say $l;' abc,def,ghi,jkl,mno abc,defghijklmno knoppix@Microknoppix:~$
I hope this is helpful.
Cheers,
JohnGG
|
|---|