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 #88739 is a reply to message #88738] Wed, 11 June 2014 07:24 Go to previous message
atmospheric physics is currently offline  atmospheric physics
Messages: 121
Registered: June 2010
Senior Member
Thank you both...

On Wednesday, June 11, 2014 3:02:06 PM UTC+2, Matthew Argall wrote:
> 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: Sat Apr 25 17:20:12 PDT 2026

Total time taken to generate the page: 0.80373 seconds