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

Home » Public Forums » archive » reading in from multiple files, performing operations and printing them to multiple output file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
reading in from multiple files, performing operations and printing them to multiple output file [message #86533] Sun, 17 November 2013 00:31 Go to previous message
bhattacharjee12 is currently offline  bhattacharjee12
Messages: 3
Registered: September 2013
Junior Member
Hi ,
I have a silly question, I feel
I am trying to run a program where I read in bunch of files, all of which have 2 sets of data and then perform the same mathematical operation on those data from each files and then put them the new values into a different set of files. I have come up with so far with this. I am having a problem in creating and printing the data into new files.

pro read_write

;;; will find the input files
files= FINDFILE('day*')

numfiles=n_elements(files)
num=intarr(numfiles)
;;;;creating an array which will have the names of the output files, still havent figured out if this necessary or not
files_out=FINDFILE('new_day*')
FOR m=0, numfiles-1 DO BEGIN
READCOL, files[m],filename1,filename2,format='F'

openw,num[m],files_out,/get_lun ;;;;;;;;;;;;might be totally off on this one.
;;;;;;;;;;;;random math operation
new_data=filename1+2
printf,new_data[m],filename[m]
close,num[m]
ENDFOR

END

I am getting an error on this syntax . I can print the outputs onto screen without any problem. So I think way I am going up with the reading and doing the operations is ok.
Thanks for the help & suggestion in advance.
Anirban
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: scatter plot , intensity colors. Help
Next Topic: Array into binary array

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

Current Time: Wed Oct 08 15:07:20 PDT 2025

Total time taken to generate the page: 0.00461 seconds