Re: need help reading ascii

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Nov 15 2012 - 08:07:38 MST

Dear Ipsita,

The last argument to readAsciiTable should be: (/number of header lines to skip, number of footer lines to skip/)

>From the file below, it looks like you have 4 header lines, and possibly no footer lines, so use (/4,0/) or just 4 for that argument, instead of (/2,2/).

In some cases, you don't even need to indicate how many footer lines you have, if they don't have any numbers in them. This function won't try to read anything that doesn't contain numbers.

--Mary

On Nov 15, 2012, at 2:45 AM, Ipsita Putatunda wrote:

> Dear NCL users,
>
> I am having a ascii file "sample.txt" in the following format. Am using 'readAsciiTable' function to read it; but it is not printing any values. My script is given below....(am using 64bit machine with NCL Version 6.1.0-17Sep2012_1431,gcc version 4.4.3)
>
> >load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> >begin
> > data_file="/media/IPSITA_PEN/binary_orbitday/2012_06_20_RHL1_ascii.txt"
> > x1=readAsciiTable(data_file,3,"float",(/2,2/))
> >print(x1)
>
> My ascii file format is as below-
>
> Column-1::Latitude
> Column-2::Longitude
> Column-3::RelativeHumidity
>
> 19.810 180.000 77.000
> 19.810 60.010 71.794
> 19.910 60.370 72.514
> 19.870 60.680 72.636
> 19.820 60.990 72.750
> 19.900 61.260 72.032
> 19.860 61.570 72.875
> 19.820 61.880 72.636
> 19.900 62.150 73.593
> 19.860 62.460 72.000
> 19.820 62.760 71.937
> 19.900 63.040 72.419
> 19.860 63.340 71.903
> 19.820 63.650 72.548
> 19.900 63.920 72.393
> 19.870 64.220 72.774
> 19.830 64.530 72.459
> 19.910 64.800 71.939
> .......................................
>
> Any help will be appreciated.
>
> Thanks,
> Ipsita
> _______________________________________________
> 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 Nov 15 08:07:48 2012

This archive was generated by hypermail 2.1.8 : Wed Nov 21 2012 - 11:16:05 MST