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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: file I/O and arithmetic calculation [message #84489] Thu, 23 May 2013 06:38 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Keira Wilson writes:

> Thank you for your response.
> This is for one file.
> How can I simulate it for five files?

Don't know. Maybe do it five times? Put it in a loop? Use variables?

These are pretty basic programming concepts. What are you doing to learn
how to program? What books have you read?

I highly recommend you get ahold of Ken Bowman's book An Introduction to
Programming with IDL.

We are generally happy to help answer questions here, but we need some
evidence of some work on your part. Otherwise, it appears you are just
asking people to do your work for you. Show us some code that doesn't
work, give us an idea why you think it doesn't work, formulate a
specific question, and we will see if we can help sort it out for you.

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.")
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 next 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.")
Re: file I/O and arithmetic calculation [message #84735 is a reply to message #84490] Thu, 23 May 2013 06:18 Go to previous messageGo to next message
Keira Wilson is currently offline  Keira Wilson
Messages: 4
Registered: May 2013
Junior Member
Dear Dr. David
Thank you for your response.
This is for one file.
How can I simulate it for five files?
Keira
Re: file I/O and arithmetic calculation [message #84736 is a reply to message #84489] Thu, 23 May 2013 07:05 Go to previous message
Keira Wilson is currently offline  Keira Wilson
Messages: 4
Registered: May 2013
Junior Member
Dear Dr. David - Thank you very much for your advice which I certainly follow to learn...
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 15:09:55 PDT 2025

Total time taken to generate the page: 0.00496 seconds