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

Home » Public Forums » archive » How to use SPAWN for creating multiple output files?
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: How to use SPAWN for creating multiple output files? [message #88738 is a reply to message #88735] Wed, 11 June 2014 06:02 Go to previous messageGo to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
Here is a longer solution. Creating the file with ">" as Mats suggested is probably faster, but in this manner you can store the checksum into a variable in case you want to do something with it.

theFiles = file_search('XYZ_*.nc')
basename = file_basename(theFiles, '.nc')
dirname = file_dirname(theFiles)
output_filenames = filepath(basename + '.sha256', ROOT_DIR=dirname)

for i = 0, nFiles - 1 do begin
spawn, 'sha256sum ' + theFiles[i], checksum

openw, lun, output_filenames[i], /GET_LUN
printf, lun, checksum
free_lun, lun
endfor
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Avoiding redefinition of variable within loop.
Next Topic: Calculate median of stacks of images using IDL

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

Current Time: Fri Oct 10 15:28:43 PDT 2025

Total time taken to generate the page: 1.44058 seconds