adding a filename into a data file

Ant Mitchell ant at
Mon Nov 5 07:32:11 PST 2012

On 5 Nov 2012, at 15:05, Hugh Gallagher <hugh at> wrote:

> Just for fun, I did it with some abuse of the default grep output and a bit of sed.
> grep '.' * | sed 's/^\([^.]*\)\.[a-z]*:/\1 /'

Just for fun, this may not do what you think it does. For example just use one file, you won't get the output you want, or use files that don't have a three letter extension, or file that is named "a:bcd:xxx" etc.

The original question was fairly generic granted, but its not a general purpose solution. 

> On 5 November 2012 14:37, Tony Edwardson <Tony.Edwardson at> wrote:
> or just
> while  (<>) {
>             print "$ARGV $_";
> }

or even: 
perl -npe 'print "$ARGV "' *

Gotta love more than one way !


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the MiltonKeynes-pm mailing list