fixer: Version 1.1 Copyright (c) 1994,1996 Karl J. Runge A script to: 1) Grab word/variable values from files to insert into Formats. 2) Print out lines matching a given Pattern. 3) Remove and/or Substitute given strings from output. 4) Print out lines occurring in the Section between given strings. 5) Print out the N-line Section occurring after a given string. 6) Do items 1-3 inside a Section specified by 4 & 5. Usage: fixer [] file1 file2 ... fileN or if files match a shell wildcard, e.g.,: fixer [] file* Options: -t Use "file" as template for searches. -o Write output to "file" instead of standard output. -overwrite Overwrite each input file with its associated output. Input file is backed up to "file.bak". -noback Do not backup if overwriting. -ext<.xxx> Place output of file1 in "file1.xxx", etc. -help Print out this info. -info -syntax Print out info on template file syntax. -d Debug mode on. -q Be quiet, don''t print information messages to STDERR. -b Print blank lines after each file. -b => one blank. -m Print "msg" after each file processed. -f Pass each file thru program before processing. The string "%s" will be expanded to the filename. -c "Compile" the template into an "inline" perl script, then exit w/o doing any runs. Use of standard input: The filename "-" means the data file is coming from stdin: cat file1 | fixer -t template - (no filenames is equivalent to the above) Compressed data: Files ending in ".gz" or ".Z" are automatically decompressed during reading. (see also -f above) Suffix: Decompression cmd: .Z => zcat %s | ... .gz => gzip -dc %s | ... -------------------------------------------------------------------- Example template: # This first Format is the header: %Format File: %_file_% Uf=%u2=% N= %n=%x%n=% L= %l=% beta= %Eval[%l=%*%dtau=%] (This work was performed on %Eval[`date`]) %EndFormat # Here is the first section we want: %Section(X): /sh 1 xx Spin correlation function:/ %EndSection: BLANK # Here is the 2nd section we want: %Section(P,X): /G(nx,ny,ti) SHEET 2:/ %Format (Hi Mom!) tau G(tau) St dev %EndFormat %Sub: /\+\-// %EndSection(X): /nx = 0 ny = 1/ -------------------------------------------------------------------- Do "fixer -info" for more information on the format of the template.