<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Times New Roman","serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-GB link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;color:#1F497D'>TIMTOWTDI<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;color:#1F497D'><o:p> </o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> MiltonKeynes-pm
[mailto:miltonkeynes-pm-bounces+tony.edwardson=lchclearnet.com@pm.org] <b>On
Behalf Of </b>Hugh Gallagher<br>
<b>Sent:</b> 05 November 2012 15:06<br>
<b>To:</b> miltonkeynes-pm@pm.org<br>
<b>Subject:</b> Re: adding a filename into a data file<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>Just for fun, I did it with some abuse of the default grep
output and a bit of sed.<o:p></o:p></p>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

<div>

<p class=MsoNormal>grep '.' * | sed 's/^\([^.]*\)\.[a-z]*:/\1 /'<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p>

<div>

<p class=MsoNormal>On 5 November 2012 14:37, Tony Edwardson <<a
href="mailto:Tony.Edwardson@lchclearnet.com" target="_blank">Tony.Edwardson@lchclearnet.com</a>>
wrote:<o:p></o:p></p>

<p class=MsoNormal>or just<br>
while  (<>) {<br>
            print "$ARGV $_";<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'>}<br>
<br>
-----Original Message-----<br>
From: MiltonKeynes-pm [mailto:<a
href="mailto:miltonkeynes-pm-bounces%2Btony.edwardson">miltonkeynes-pm-bounces+tony.edwardson</a>=<a
href="mailto:lchclearnet.com@pm.org">lchclearnet.com@pm.org</a>] On Behalf Of
Benjamin Martin<br>
Sent: 05 November 2012 14:33<br>
To: <a href="mailto:miltonkeynes-pm@pm.org">miltonkeynes-pm@pm.org</a><br>
Subject: Re: adding a filename into a data file<br>
<br>
On 05/11/12 14:13, Matt Croft wrote:<br>
> Is this possible in perl?<br>
<br>
Something like this:<br>
<br>
#!/usr/bin/env perl<br>
<br>
use strict;<br>
use warnings;<br>
use autodie;<br>
<br>
my $base_dir = "/home/person";   # as base dir to read/write
file to/from<br>
my @files = qw/file1.txt file2.txt/;  # the files to read and combine<br>
<br>
open $new_fh, ">", "$base_dir/NEWFILE.txt"; # open the
master file to<br>
receive all files content<br>
foreach my $f (@files) {<br>
<br>
   my $fh<br>
   open $fh, "<", "$base_dir/$f";<br>
   while(<$fh>) {<br>
     print $new_fh "$f $_";<br>
   }<br>
   close $fh;<br>
<br>
}<br>
close $fh2;<br>
<br>
<br>
This email, its content and any files transmitted with it are intended solely
for the addressee(s) and may be legally privileged and/or confidential. If you
are not the intended recipient, you may not divulge any of its contents to anyone
and should delete the email and contact the sender on the telephone number
shown above or via return email. Messages sent via this medium may be subject
to delays, non-delivery and unauthorised alteration.  This email has been
prepared using information believed by the author to be reliable and accurate,
but neither TwentyCi Limited, nor any of its subsidiaries or associates makes
any warranty as to its accuracy or completeness.  Any opinions or
recommendations expressed herein are solely those of the author. TwentyCi
Limited is a company registered in England, No.06943607. The registered office
address is: 6 Whittle Court Knowlhill Milton Keynes MK5 8FT<br>
_______________________________________________<br>
MiltonKeynes-pm mailing list<br>
<a href="mailto:MiltonKeynes-pm@pm.org">MiltonKeynes-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/miltonkeynes-pm" target="_blank">http://mail.pm.org/mailman/listinfo/miltonkeynes-pm</a><br>
<br>
<o:p></o:p></p>

</div>

</div>

<p class=MsoNormal>A copy of the LCH.Clearnet e-mail disclaimer can be found
at: <a href="http://www.lchclearnet.com/disclaimer/email" target="_blank">www.lchclearnet.com/disclaimer/email</a>
 <br>
<br>
LCH.Clearnet Limited, Registered Office: Aldgate House, 33 Aldgate High Street,
London EC3N 1EA.<br>
Recognised as a Clearing House under the Financial Services & Markets Act
2000. Reg in England No.25932.<br>
LCH.Clearnet SA, Siège Social, 18 rue du Quatre Septembre, 75002 Paris, Chambre
de Compensation conformément au Code Monétaire et Financier.<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal>_______________________________________________<br>
MiltonKeynes-pm mailing list<br>
<a href="mailto:MiltonKeynes-pm@pm.org">MiltonKeynes-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/miltonkeynes-pm" target="_blank">http://mail.pm.org/mailman/listinfo/miltonkeynes-pm</a><o:p></o:p></p>

</div>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

</div>

</body>

</html>