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

Home » Public Forums » archive » Auto-path finding when writing 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
Auto-path finding when writing file [message #94593] Tue, 18 July 2017 07:23 Go to previous message
thtran296 is currently offline  thtran296
Messages: 8
Registered: June 2017
Junior Member
Thank you so much guys for helping me with IDL recently.
I truly appreciate all the help and feedback.

So I have successfully written a loop that will write 365 separate files (named Day1, Day2, Day3, .. so on).
The problem is, all of these text files were placed in this directory: HDD-Users-Sam
This is messy.

I have already created 12 separate folders (named January to December). Ultimately, I want IDL to write the above 365 files to the appropriate folder.
For example, the file Day1 would be written in the folder January, and the file Day350 would be written in the folder December.

How would I do this?
Again, thank you very much.

Here's what I have so far:
data = .......... (my data goes in here)
arr = string(intarr(1,365))
for j = 0,364 do begin
arr(j) = 'Day'+ strtrim(string(j),2) + '.dat'
get_lun, unit
openw, unit, arr(j), /get_lun
printf, unit, data
close, unit
endfor
[Message index]
 
Read Message
Read Message
Previous Topic: Writing to Multiple txt file with different names
Next Topic: converting xy to lon lat

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

Current Time: Wed Oct 08 11:48:35 PDT 2025

Total time taken to generate the page: 0.00197 seconds