AFNI program: file_tool

Output of -help



/var/www/html/pub/dist/bin/linux_gcc32/file_tool - display or modify sections of a file

    This program can be used to display or edit data in arbitrary
    files.  If no '-mod_data' option is provided (with DATA), it
    is assumed the user wishes only to display the specified data
    (using both '-offset' and '-length', or using '-ge_XXX').

  usage: /var/www/html/pub/dist/bin/linux_gcc32/file_tool [options] -infiles file1 file2 ...

  examples:

   ----- help examples -----

   1. get detailed help:

      /var/www/html/pub/dist/bin/linux_gcc32/file_tool -help

   2. get descriptions of GE struct elements:

      /var/www/html/pub/dist/bin/linux_gcc32/file_tool -help_ge

   ----- GEMS 4.x and 5.x display examples -----

   3. display GE header and extras info for file I.100:

      /var/www/html/pub/dist/bin/linux_gcc32/file_tool -ge_all -infiles I.100

   4. display GEMS 4.x series and image headers for file I.100:

      /var/www/html/pub/dist/bin/linux_gcc32/file_tool -ge4_all -infiles I.100

   5. display run numbers for every 100th I-file in this directory

      /var/www/html/pub/dist/bin/linux_gcc32/file_tool -ge_uv17 -infiles I.?42
      /var/www/html/pub/dist/bin/linux_gcc32/file_tool -ge_run  -infiles I.?42

   ----- general value display examples -----

   6. display the 32 characters located 100 bytes into each file:

      /var/www/html/pub/dist/bin/linux_gcc32/file_tool -offset 100 -length 32 -infiles file1 file2

   7. display the 8 4-byte reals located 100 bytes into each file:

      /var/www/html/pub/dist/bin/linux_gcc32/file_tool -disp_real4 -offset 100 -length 32 -infiles file1 file2

   ----- character modification examples -----

   8. in each file, change the 8 characters at 2515 to 'hi there':

      /var/www/html/pub/dist/bin/linux_gcc32/file_tool -mod_data "hi there" -offset 2515 -length 8 -infiles I.*

   9. in each file, change the 21 characters at 2515 to all 'x's
      (and print out extra debug info)

      /var/www/html/pub/dist/bin/linux_gcc32/file_tool -debug 1 -mod_data x -mod_type val -offset 2515 \
                -length 21 -infiles I.*

   ----- raw number modification examples -----

  10. in each file, change the 3 short integers starting at position
      2508 to '2 -419 17'

      /var/www/html/pub/dist/bin/linux_gcc32/file_tool -mod_data '2 -419 17' -mod_type sint2 -offset 2508 \
                -length 6 -infiles I.*

  11. in each file, change the 3 binary floats starting at position
      2508 to '-83.4 2 17' (and set the next 8 bytes to zero by
      setting the length to 20, instead of just 12).

      /var/www/html/pub/dist/bin/linux_gcc32/file_tool -mod_data '-83.4 2 17' -mod_type float4 -offset 2508 \
                -length 20 -infiles I.*

  12. in each file, change the 3 binary floats starting at position
      2508 to '-83.4 2 17', and apply byte swapping

      /var/www/html/pub/dist/bin/linux_gcc32/file_tool -mod_data '-83.4 2 17' -mod_type float4 -offset 2508 \
                -length 12 -swap_bytes -infiles I.*

  notes:

    o  Use of '-infiles' is required.
    o  Use of '-length' or a GE information option is required.
    o  As of this version, only modification with text is supported.
       Editing binary data is coming soon to a workstation near you.

  special options:

    -help              : show this help information
                       : e.g. -help

    -version           : show version information
                       : e.g. -version

    -hist              : show the program's modification history

    -debug LEVEL       : print extra info along the way
                       : e.g. -debug 1
                       : default is 0, max is 2

  required 'options':

    -infiles f1 f2 ... : specify input files to print from or modify
                       : e.g. -infiles file1
                       : e.g. -infiles I.*

          Note that '-infiles' should be the final option.  This is
          to allow the user an arbitrary number of input files.

  GE info options:

      -ge_all          : display GE header and extras info
      -ge_header       : display GE header info
      -ge_extras       : display extra GE image info
      -ge_uv17         : display the value of uv17 (the run #)
      -ge_run          : (same as -ge_uv17)
      -ge_off          : display file offsets for various fields

  GEMS 4.x info options:

      -ge4_all         : display GEMS 4.x series and image headers
      -ge4_image       : display GEMS 4.x image header
      -ge4_series      : display GEMS 4.x series header
      -ge4_study       : display GEMS 4.x study header

  raw ascii options:

    -length LENGTH     : specify the number of bytes to print/modify
                       : e.g. -length 17

          This includes numbers after the conversion to binary.  So
          if -mod_data is '2 -63 186', and -mod_type is 'sint2' (or
          signed shorts), then 6 bytes will be written (2 bytes for
          each of 3 short integers).

       ** Note that if the -length argument is MORE than what is
          needed to write the numbers out, the remaind of the length
          bytes will be written with zeros.  If '17' is given for
          the length, and 3 short integers are given as data, there 
          will be 11 bytes of 0 written after the 6 bytes of data.

    -mod_data DATA     : specify a string to change the data to
                       : e.g. -mod_data hello
                       : e.g. -mod_data '2 -17.4 649'
                       : e.g. -mod_data "change to this string"

          This is the data that will be writting into the modified
          file.  If the -mod_type is 'str' or 'char', then the
          output data will be those characters.  If the -mod_type
          is any other (i.e. a binary numerical format), then the
          output will be the -mod_data, converted from numerical
          text to binary.

       ** Note that a list of numbers must be contained in quotes,
          so that it will be processed as a single parameter.

    -mod_type TYPE     : specify the data type to write to the file
                       : e.g. -mod_type string
                       : e.g. -mod_type sint2
                       : e.g. -mod_type float4
                       : default is 'str'

        TYPE can be one of:

          str       : perform a string substitution
          char, val : perform a (repeated?) character substitution
          uint1     : single byte unsigned int   (binary write)
          sint1     : single byte   signed int   (binary write)
          uint2     : two    byte unsigned int   (binary write)
          sint2     : two    byte   signed int   (binary write)
          uint4     : four   byte unsigned int   (binary write)
          sint4     : four   byte   signed int   (binary write)
          float4    : four   byte floating point (binary write)
          float8    : eight  byte floating point (binary write)

          If 'str' is used, which is the default action, the data is
          replaced by the contents of the string DATA (from the
          '-mod_data' option).

          If 'char' is used, then LENGTH bytes are replaced by the
          first character of DATA, repeated LENGTH times.

          For any of the others, the list of numbers found in the
          -mod_data option will be written in the supplied binary
          format.  LENGTH must be large enough to accomodate this
          list.  And if LENGTH is higher, the output will be padded
          with zeros, to fill to the requesed length.

    -offset OFFSET     : use this offset into each file
                       : e.g. -offset 100
                       : default is 0

          This is the offset into each file for the data to be
          read or modified.

    -quiet             : do not output header information

  numeric options:

    -disp_int2         : display 2-byte integers
                       : e.g. -disp_int2

    -disp_int4         : display 4-byte integers
                       : e.g. -disp_int4

    -disp_real4        : display 4-byte real numbers
                       : e.g. -disp_real4

    -swap_bytes        : use byte-swapping on numbers
                       : e.g. -swap_bytes

          If this option is used, then byte swapping is done on any
          multi-byte numbers read from or written to the file.

  - R Reynolds, version: 3.2 (March 24, 2004), compiled: Aug  3 2004


This page generated on Tue Aug 3 16:42:46 EDT 2004