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 #88736 is a reply to message #88735] Wed, 11 June 2014 05:40 Go to previous messageGo to previous message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den onsdagen den 11:e juni 2014 kl. 12:00:57 UTC+2 skrev Madhavan Bomidi:
> Hello,
>
> I have multiple *.nc files. I want to create SHA 256 checksum file for each of the datafile.
>
> In linux shell, I get the checksum info as:
>
> $ sha256sum XYZ_1000.nc'
>
> 89654655f1a75fc398fb86c9f56c255bb991768eb223a6defa1f1d5d0ede f6aa XYZ_1000.nc
>
> So, I tried to use the same in IDL as below:
>
> IDL> spawn, 'sha256sum XYZ_201304000.nc'
>
> 89654655f1a75fc398fb86c9f56c255bb991768eb223a6defa1f1d5d0ede f6aa XYZ_1000.nc
>
> As I have created all the *.nc data files in IDL program, I would like to add few lines below to create respective checksum file (e.g., <myfile>.sha256 ).
>
> I have my datafiles as - XYZ_1000.nc, XYZ_1001.nc, XYZ_1002.nc, ....
>
> I would like to copy the checksum output
>
> 89654655f1a75fc398fb86c9f56c255bb991768eb223a6defa1f1d5d0ede f6aa
>
> to the new file - XYZ_1000.sha256
>
> I know it can be done directly on linux terminal but I want to create simultaneously in the IDL code.
>
> Can anyone help me how I can do this in IDL using SPAWN command?
>
> Thanks in advance,
>
> Madhavan

Something like this should work (untested):

IDL> myfile='XYZ_1000'
IDL> spawn, 'sha256sum '+myfile+'.nc > '+myfile+'.sha256'
[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 17:52:28 PDT 2025

Total time taken to generate the page: 1.20223 seconds