Dear Chloe, <br> John Doe`s script is a good start, even though it will work for single words space separated. The LINE Variable only passes the Arguments as single words to ($1 and $2 respectively). I will also work on something for you too...<br>
<br><div class="gmail_quote">On Thu, Jun 18, 2009 at 10:34 AM, John Doe <span dir="ltr"><<a href="mailto:jdmls@yahoo.com">jdmls@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
From: chloe K <<a href="mailto:chloekcy2000@yahoo.ca">chloekcy2000@yahoo.ca</a>><br>
> I have a file. list.txt (two columns)<br>
><br>
> column1 column2<br>
> name address<br>
><br>
> I need to put in the letter file letter.txt eg:<br>
><br>
> Dear: Chloe<br>
> Address: CA<br>
><br>
> Can I use this<br>
><br>
> for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt<br>
<br>
For single words space separated:<br>
<br>
cat list.txt | while read LINE<br>
do<br>
set $LINE<br>
printf "Dear: %s\nAddress: %s\n" $1 $2 >> $1.letter.txt<br>
done<br>
<br>
JD<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
CentOS mailing list<br>
<a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>
<a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
</blockquote></div><br>