write csv to ascii

From: Luo, Chao <chao.luo_at_nyahnyahspammersnyahnyah>
Date: Thu Oct 04 2012 - 10:36:31 MDT

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
Received on Thu Oct 4 10:36:42 2012

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