comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: file I/O and arithmetic calculation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: file I/O and arithmetic calculation [message #84490 is a reply to message #84489] Thu, 23 May 2013 04:59 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Keira Wilson writes:

> I would be grateful if someone could guide me:
> I have five text files each of 7 columns by 9 rows
> file_one = 'C:\one.txt'
> file_two = 'C:\two.txt'
> . . .
> file_five = 'C:\five.txt'
>
> How can I calculate the mean of first row for each file, if mean of first column of each file is 50?
> I would appreciate a very simple code to be learn.

What do you imagine the mean of the first column of data has to do with
the mean of the first row of the data? This is kind of like learning
your dentist has three children.

Anyway, something like this would work:

Openr, lun, file_one, /Get_lun
row = Fltarr(7)
ReadF, lun, row
meanRow1 = Mean(row)
Free_Lun, lun

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: file I/O and arithmetic calculation
Next Topic: Re: Good practices with hashes

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 07:28:04 PDT 2025

Total time taken to generate the page: 0.95844 seconds