Lets say I have the following lines:
1:a:b:c 2:d:e:f 3:a:b 4:a:b:c:d:e:f
how can I edit this with sed (or perl) in order to read:
1a1b1c 2d2e2f
#!/usr/bin/perl use warnings; use strict; while () { if ( s/^([^:]+)// ) { my $delim = $1; s/:/$delim/g; } print; } __DATA__ 1:a:b:c 2:d:e:f 3:a:b 4:a:b:c:d:e:f