[Thread Prev][Thread Next][Index]

Re: Putting two vars into one 2-level var



Hi Gary,

I would use awk to solve the problem:

list/file=f2var/format=(F8.2 F8.2)/nohead hi,lo
sp cat f2var | awk '{printf("%f\n%f\n",$1,$2)}' > f1var
file/var=both f1var
list both


Paulo.



Gary Strand wrote:
> 
> Suppose I have a file that has two variables, 'hi' and 'lo'.
> 
> How can I put those onto a new variable, 'both', that has two levels, such that
> both[k=1] = lo, and both[k=2] = hi?
> 
> I don't know quite how to define axes/grids (if necessary) to do this.
> 
> Thanks!
> --
> /\        Gary Strand (303) 497-1336                                NCAR CG2260
>   \_][    www.cgd.ucar.edu/ccr/strandwg                    3080 Center Green Dr
>       \___strandwg@ucar.edu                       Boulder, Colorado, USA  80301


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement