next up previous 405
Next: Wildcarded lists of files
Up: Process a Series of Files
Previous: Process a Series of Files


NDFs

Some data formats like the NDF demand that only the file name (i.e. what appears before the last dot) be given in commands. To achieve this you must first strip off the remainder (the file extension or type) with the :r file modifier.

     foreach file (*.sdf)
        histogram $file:r accept
     end

This processes all the HDS files in the current directory and calculates an histogram for each of them using the histogram command from KAPPA. It assumes that the files are NDFs. The :r instructs the shell to remove the file extension (the part of the name following the the rightmost full stop). If we didn't do this, the histogram task would try to find NDFs called SDF within each of the HDS files.



next up previous 405
Next: Wildcarded lists of files
Up: Process a Series of Files
Previous: Process a Series of Files

C-shell Cookbook
Starlink Cookbook 4
Malcolm J. Currie
2006 November 26
E-mail:ussc@star.rl.ac.uk

Copyright © 2009 Science and Technology Facilities Council