[gradsusr] Open text file and output as a csv format in GRADS

Sestak, Michael L CIV 63134 michael.l.sestak at navy.mil
Tue May 28 10:52:29 EDT 2013


The read function in the grads scripting language will open a text file, then you have to parse your dates using substr.

But, all that can be done in fortran, and CSV usually means comma separated values, not columns. 

So, I'm not sure what you really want to do.

Michael Sestak
Fleet Numerical Meteorology and Oceanography Center
Monterey, CA

Message: 1
Date: Tue, 28 May 2013 11:26:24 +0800
From: Lyndon Mark Olaguera <olagueralyndonmark429 at gmail.com>
Subject: [gradsusr] Open text file and output as a csv format in GRADS
To: GrADS Users Forum <gradsusr at gradsusr.org>
Message-ID:
	<CA+V+8dWb8qXJt37XMU=K-51hNC=NmuQ3fx27ApOXoPLopF+mgw at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi all,
I have station data in a text file and I want to read it using grads and output as a csv file.
The problem is the dates are separated by a backslash...
here's a sample format:

The text file contains the following data.

yy/mm/dd/hh               pressure           rain
TEMPERATURE      wind speed
2012/08/06/00               10000               2.5
300                   45
...
...
...
....


I want to oputput this in a csv format such that the the years, months, days, and hours are in separated in columns...
like:

yy             mm           dd      hh      rain
temperature           wind speed



I can't do it in fortran so i guess its easier to do this in GRADs..


thanks for any help.
Lyndon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5571 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20130528/b09957e7/attachment-0003.bin 


More information about the gradsusr mailing list