Gamma DISP: Reference Manual


set_value

ANSI-C program: set_value.c

NAME
set_value - Set new value in a keyword based parameter file.

SYNOPSIS

set_value <PAR_in> <PAR_out> <keyword> <value> [new_key]

<PAR_in> input keyword:value based parameter file
<PAR_out> output keyword:value based parameter file (can be the same file as PAR_in)
<keyword> search keyword of keyword:value pair
<value> new value (note: delimit value with double quotes if it contains spaces or punctuation)
[new_key] 0=default: new keyword:value pair not permitted 1:insert new keyword:value pair (default:0=entire file)

EXAMPLE
set_value 05263.slc.par 05263.slc.par image_format SCOMPLEX 1

appends the keyword:value pair

image_format: SCOMPLEX

to parameter file 05263.slc.par

DESCRIPTION
set_value reads the input keyword: value organized parameter file a line at a time searching for the keyword. A semicolon is used to denote the end of a keyword and a newline denotes the end of a line. If the keyword is found then the value is updated to the new value given on the command line. If the keyword is not found, the current line is copied to the output buffer and the scan continues through the file. After the scan is completed and the keyword has not been found, then a new keyword: value pair is appended at the end of the parameter file given that the value of new_key is 1. Otherwise, the input and output files are identical.

The input file and output file can have identical names because the output is stored in a temporary buffer until the search is completed. The keyword and value arguments can have embedded spaces if they are enclosed in double quotes.


© Copyrights for Documentation, and Reference Manual by Gamma Remote Sensing, 2006.
UW, CW, last change 11-Apr-2006.