[ncl-talk] formatted output (write_table)

Rick Brownrigg brownrig at ucar.edu
Wed Sep 20 10:12:00 MDT 2017


Hi,

I don't see where you are creating the list needed for the write_table
command. I would think it should look like:

alist = [/ nom, idis, lon, lat /]

Hope that helps...
Rick


On Wed, Sep 20, 2017 at 9:59 AM, ousmane ndiaye <ondiaye70 at gmail.com> wrote:

> hi,
> 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
> ==
>
> lines = asciiread("stat_station.csv",-1,"string")
>
> nom = str_get_field(lines(0:),1,",")
>
> idis=stringtofloat(str_get_field(lines(0:),2,","))
>
> lon=stringtofloat(str_get_field(lines(0:),3,","))
>
> lat=stringtofloat(str_get_field(lines(0:),4,","))
>
> write_table("dat1.txt", "w", alist1, "%s %2.0f %5.1f %5.1f ")
>
> ==
>
> any help
>
> I want to rewrite to this output format :
>
> BAKEL 1 -12.46666 14.9
> BAMBEY -1 -16.46666 14.7
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170920/7606c6fc/attachment.html>


More information about the ncl-talk mailing list