Re: write csv to ascii

From: Wei Huang <huangwei_at_nyahnyahspammersnyahnyah>
Date: Thu Oct 04 2012 - 10:51:18 MDT

Chao,

You may try "str_write" (in 6.1.0-beta), which will be renamed to "write_table" (in 6.1.0).
http://www.ncl.ucar.edu/Document/Functions/Built-in/str_write.shtml

Wei

huangwei@ucar.edu
VETS/CISL
National Center for Atmospheric Research
P.O. Box 3000 (1850 Table Mesa Dr.)
Boulder, CO 80307-3000 USA
(303) 497-8924

On Oct 4, 2012, at 10:36 AM, Luo, Chao wrote:

> Hi,
>
> I read csv format file, (which was mixed with strings and numbers), and want to write some columns of file with format (like (2A20, F12.4)). Here is my script, which doesn't work.
>
> --------------------------------------------------
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> begin
> filename = "/data11/cluo/GAfire/GAPermit/dat/2012-MarApr-GFCPermits.csv"
>
> ;---Read in file as array of strings so we can parse each line
> lines = asciiread(filename,-1,"string")
> delim = ","
> y = str_split_csv(lines, ",", 0)
> asciiwrite("tst.txt1",y(:,5),y(:8),y(:,11))
> end
> -------------------------------------------------
>
> Very appreciate your help!
>
> CL
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Oct 4 10:51:31 2012

This archive was generated by hypermail 2.1.8 : Mon Oct 08 2012 - 15:54:16 MDT