[ncl-talk] Sub: Extracting a specific column...

Dennis Shea shea at ucar.edu
Sun Oct 18 15:34:40 MDT 2015


Please read NCL documentation:

http://www.ncl.ucar.edu/Document/Functions/Contributed/numAsciiRow.shtml
http://www.ncl.ucar.edu/Document/Functions/Contributed/numAsciiCol.shtml

   dira = "./"
   fila   = "ao1961-2005.asc"
   ptha = dira+fila
   ncol = 12
   nrow = numAsciiRow(ptha)

   data = asciiread(ptha, (/nrow,ncol/), "float")

; NCL column numbering starts with zero [ 0 ]
; to get 5th column

   x = data(:,6)
   print(x)

On Sun, Oct 18, 2015 at 2:24 PM, Adv <advita6 at gmail.com> wrote:
> Hi NCL users,
> I would like to extract a specific column from the text file. Could someone
> help me?
>
> Thank you
> Adv
>
> my code look like this... begin
> ;***************************************************
> ;s=new((/1,12/),float,"No_FillValue")
> z1 = asciiread("ao1961-2005.asc",-1,"float")
> print(z1)
> xreshape = reshape(z1,(/1,5/))
> end
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


More information about the ncl-talk mailing list