read text
DeliaChen
delia at NAT.AS.NTU.EDU.TW
Wed Dec 13 11:14:13 EST 2006
Hi
Try to write below program in you gs file
-----------------------------
i=1
while(i<=600)
res=read('aaa.txt') <---your textfile for example named
aaa.txt
x.i=subwrd(res,2)
i=i+1
endwhile
----------------------------
then you can call your data by x.1, x.2 .... etc
-------------------------------------------
Yen-Chu Delia Chen
Department of Atmospheric Sciences
National Taiwan University
1, Sec. 4, Roosevelt Rd.
Taipei 106, Taiwan
E-mail: delia at nat.as.ntu.edu.tw
----- Original Message -----
From: "lorna nayagam" <lorna_arn at YAHOO.COM>
To: <GRADSUSR at LIST.CINECA.IT>
Sent: Wednesday, December 13, 2006 8:10 PM
Subject: read text
> Hello gradsusers,
>
> I have a text file containing 600 values in a file
> data.txt. the contents of the file is like (single
> column, 600 lines)
>
> 300.992
> 299.981
> 289.237
> .......
> .......
> .......
>
>
> I want to read the lines from the text file and assign
> them as follows.
> x1=300.992
> x2=299.981
> ..........
> x600=.....
>
>
> can anybody help me? how to do this? i want to take
> them after calling x1, x2, ..... and do calculations.
> Kindly give a suggestion.
> thanks,
> lorna
>
> Ms. Lorna R. Nayagam,
> Junior Research Fellow,
> Department of Atmospheric Sciences,
> Cochin University of Science and Technology,
> Finearts Avenue, Cochin 682016
>
>
>
>
> ____________________________________________________________________________________
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail beta.
> http://new.mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20061214/4bc98982/attachment.html
More information about the gradsusr
mailing list