<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi<br>
<br>
If your file has only 2 columns and there is no space exists in 2nd
column then you can use this script<br>
<br>
#!/bin/sh<br>
FILE="list.txt"<br>
OUTPUT="out.txt"<br>
while read VAL<br>
<br>
do<br>
VAL1=$(echo $VAL | awk '{print $1}' )<br>
VAL2=$(echo $VAL | awk '{print $2}' )<br>
<br>
echo "DEAR: $VAL1" >> $OUPUT<br>
echo "DEAR: $VAL2" >> $OUPUT<br>
echo " ">> $OUTPUT<br>
<br>
done<$FILE<br>
<br>
if you have spaces in between your 2nd column you might have to format
the file using awk/sed<br>
so that there would be a valid delimeter between column1 and column2<br>
<br>
column 1| column2 here we can use '|' as the delimeter and change awk
statement <br>
to awk -F '| ' '{print $1}' or something like this.<br>
<br>
--<br>
Regards,<br>
Mohan.<br>
<br>
<br>
<br>
chloe K wrote:
<blockquote cite="mid:244515.44324.qm@web57409.mail.re1.yahoo.com"
type="cite">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td
style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;"
valign="top">
<div>Hi</div>
<div> </div>
<div>I have a file. list.txt (two columns)</div>
<div> </div>
<div>column1 column2</div>
<div>name address</div>
<div> </div>
<div> </div>
<div>I need to put in the letter file letter.txt eg:</div>
<div> </div>
<div>Dear: Chloe</div>
<div>Address: CA</div>
<div> </div>
<div>Can I use this </div>
<div> </div>
<div>for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g'
$i.letter.txt</div>
<div> </div>
<div>Thank you for your help</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
</td>
</tr>
</tbody>
</table>
<br>
<hr size="1">Looking for the perfect gift?<a moz-do-not-send="true"
href="http://www.flickr.com/gift/"><b> Give the gift of Flickr!</b></a>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
CentOS mailing list
<a class="moz-txt-link-abbreviated" href="mailto:CentOS@centos.org">CentOS@centos.org</a>
<a class="moz-txt-link-freetext" href="http://lists.centos.org/mailman/listinfo/centos">http://lists.centos.org/mailman/listinfo/centos</a>
</pre>
</blockquote>
</body>
</html>