<div dir="ltr"><div><div><div><div>Hi,<br><br></div>I don't see where you are creating the list needed for the write_table command. I would think it should look like:<br><br></div>alist = [/ nom, idis, lon, lat /]<br><br></div>Hope that helps...<br></div>Rick<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 20, 2017 at 9:59 AM, ousmane ndiaye <span dir="ltr"><<a href="mailto:ondiaye70@gmail.com" target="_blank">ondiaye70@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">hi,<div>I am reading a file with text and numbers and want to rewrite it with a format i am using this program but it is not working </div><div>==</div><div>







<p class="m_-2215960696843343324gmail-p1"><span class="m_-2215960696843343324gmail-s1">lines = asciiread("stat_station.csv",-<wbr>1,"string")</span></p>
<p class="m_-2215960696843343324gmail-p1"><span class="m_-2215960696843343324gmail-s1">nom = str_get_field(lines(0:),1,",")</span></p>
<p class="m_-2215960696843343324gmail-p1"><span class="m_-2215960696843343324gmail-s1">idis=stringtofloat(str_get_<wbr>field(lines(0:),2,","))</span></p>
<p class="m_-2215960696843343324gmail-p1"><span class="m_-2215960696843343324gmail-s1">lon=stringtofloat(str_get_<wbr>field(lines(0:),3,","))</span></p>
<p class="m_-2215960696843343324gmail-p1"><span class="m_-2215960696843343324gmail-s1">lat=stringtofloat(str_get_<wbr>field(lines(0:),4,","))</span></p>
<p class="m_-2215960696843343324gmail-p2">write_table("dat1.txt", "w", alist1, "%s %2.0f %5.1f %5.1f ")<br><span class="m_-2215960696843343324gmail-s1"></span></p><p class="m_-2215960696843343324gmail-p1"><span class="m_-2215960696843343324gmail-s1">==</span></p><p class="m_-2215960696843343324gmail-p1"><span class="m_-2215960696843343324gmail-s1">any help</span></p><p class="m_-2215960696843343324gmail-p1"><span class="m_-2215960696843343324gmail-s1">I want to rewrite to this output format :</span></p><p class="m_-2215960696843343324gmail-p1"><span class="m_-2215960696843343324gmail-s1">









</span></p><table style="border-collapse:collapse;width:260pt" cellspacing="0" cellpadding="0" border="0" width="348">

 <colgroup><col style="width:65pt" width="87" span="4">
 </colgroup><tbody><tr style="height:16pt" height="21">
  <td style="height:16pt;width:65pt" width="87" height="21">BAKEL</td>
  <td style="width:65pt" width="87" align="right">1</td>
  <td style="width:65pt" width="87" align="right">-12.46666</td>
  <td style="width:65pt" width="87" align="right">14.9</td>
 </tr>
 <tr style="height:16pt" height="21">
  <td style="height:16pt" height="21">BAMBEY</td>
  <td align="right">-1</td>
  <td align="right">-16.46666</td>
  <td align="right">14.7</td>
 </tr>
 <tr style="height:16pt" height="21">
  <td style="height:16pt" height="21"><br></td><td align="right"></td><td align="right"></td><td align="right"></td></tr></tbody></table></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>