m.in.stf1.tape(1)	      Grass User's Manual	     m.in.stf1.tape(1)



NNAAMMEE
       mm..iinn..ssttff11..ttaappee	-  Filter  to  extract lines from a text file based on
       column contents, especially for Bureau of the Census STF1 files.
       _(_G_R_A_S_S _S_u_p_p_o_r_t _P_r_o_g_r_a_m_)

SSYYNNOOPPSSIISS
       mm..iinn..ssttff11..ttaappee
       mm..iinn..ssttff11..ttaappee hheellpp
       mm..iinn..ssttff11..ttaappee --ff
       mm..iinn..ssttff11..ttaappee [[--nn]] sscc==ssttrr [[sscc==ssttrr .. .. ..]]  oouuttffiillee


       This program must be run in command mode only.



PPAARRAAMMEETTEERRSS
       _s_c is a starting column number of a desired field in the input file, or
       is  the	name  of one of the Identification Section field names for the
       STF1 records (all upper case letters), and _s_t_r is  a  string  to  match
       against	input  lines  starting	at  column  _s_c. _s_c_=_s_t_r may be repeated
       resulting in a conjunction (anding)  of	the  results  of  each	_s_c_=_s_t_r
       expression.   A '?' may be used as a single character wild card in _s_t_r;
       if _s_c_=_s_t_r contains '?' or other shell interpreted characters, it should
       be  protected  in quotes.  Preceeding _s_c by 'N', or preceeding the _= by
       '!' reverses the sense of the test ("not equals").


       mm..iinn..ssttff11..ttaappee _1_1_=_0_5_0	_o_u_t_f_i_l_e  mm..iinn..ssttff11..ttaappee  _S_U_M_L_E_V_=_0_5_0    _o_u_t_f_i_l_e
       mm..iinn..ssttff11..ttaappee	_1_=_T_4_5_0	 _'_7_=_B_u_?_?_s_'   _o_u_t_f_i_l_e  mm..iinn..ssttff11..ttaappee  _5_1_=_t_r_a_c_t
       _N_3_7_=_9_7_5_3  _o_u_t_f_i_l_e mm..iinn..ssttff11..ttaappee _5_1_=_t_r_a_c_t _3_7_!_=_9_7_5_3  _o_u_t_f_i_l_e

       Running the program with the _-_f flag generates the list of STF1 Identi-
       fication Section field names to stdout.



DDEESSCCRRIIPPTTIIOONN
       This  is a text filter program written in C especially to work with the
       Census STF1 files, but useful for selecting subsets of lines  from  any
       text  file.   It  will  work  with  arbitrarily long input lines, up to
       10,000 characters.  Input lines may be of variable length.


       A _s_c_=_s_t_r condition which refers to columns beyond the end of the  input
       line is assumed to be true.


       Multiple  tests	are  'anded'  into a single test; that is, lines which
       pass all tests are written to the output file.


       Null characters are always filtered out; thus, this program can be used
       as  a null filter by specifying a _s_c_=_s_t_r condition which will always be
       true (e.g., '1=?').  In the same way, files with lines terminated  with
       or just <;CR>; can be "fixed" to have the standard Unix	terminator.


       NOTE:  One special property of _m_._i_n_._s_t_f_1_._t_a_p_e is that it will pad (with
       0) its output lines to 4806 characters if  the  line  begins  with  the
       characters "STF1" and is greater than 4000 characters long.  Experience
       has shown that some STF1 records are a few  characters  short  (but  no
       data  has  been omitted), and this corrects them so that other programs
       will be able to read full lines.



BBUUGGSS//FFEEAATTUURREESS
       Input lines must be terminated with ,  or <;LF>;<;CR>;.	 Output  lines
       will be terminated with	only.


       Input characters lexically less than 'space' (32 decimal; the "control"
       characters) which are not line terminators will be  perceived  as  line
       terminators and thus cause improper functioning.



SSEEEE AALLSSOO
       For extracting lines from files, Unix programs such as _g_r_e_p, or _a_w_k are
       somewhat more flexible than _m_._i_n_._s_t_f_1_._t_a_p_e, but have line length  limi-
       tations and do not adapt to lines terminated with  and .


       This  program  was  created as a preprocessor for Census STF1 files, to
       produce input files for the program _v_._a_p_p_l_y_._c_e_n_s_u_s .



AAUUTTHHOORR
       Dr. James Hinthorne, GIS Laboratory, Central Washington University.



       _L_a_s_t _c_h_a_n_g_e_d_: _$_D_a_t_e_: _2_0_0_2_/_0_1_/_2_5 _0_5_:_4_5_:_3_3 _$



GRASS 5.0						     m.in.stf1.tape(1)
